Skip to content

Commit

Permalink
Add info about Trusted Publishers
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-kipawa committed Oct 4, 2024
1 parent eb318fb commit de8e1d8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions 07_packaging.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,15 @@ To use secrets as environment variables in GitHub Actions, add them to the `env`

```yaml
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
USERNAME: ${{ secrets.USERNAME }}
PASSWORD: ${{ secrets.PASSWORD }}
```
## GitHub Actions {.smaller}
* Modern publishing uses Trusted Publishers.
* Avoids managing secrets in the repository.
```{.yaml filename=.github/workflows/python_publish.yml code-line-numbers="|2-4|18-19|20-21"}
name: Publish Python Package
on:
Expand Down Expand Up @@ -330,6 +333,8 @@ jobs:
. . .
Example:
```{.yaml filename=.github/workflows/python_publish.yml code-line-numbers="|3-4|5-6"}
- name: Build package
run: python -m build
Expand Down

0 comments on commit de8e1d8

Please sign in to comment.