Skip to content

Commit

Permalink
Update publishing step to use hatch publish action
Browse files Browse the repository at this point in the history
This is the recommended best practice, according to some.
  • Loading branch information
nisimond committed Feb 28, 2024
1 parent 7e40978 commit 7aa6051
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ jobs:
deploy:

runs-on: ubuntu-latest

permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -18,11 +19,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
hatch build
twine upload dist/*
pip install hatch
- name: Build package
run: hatch build
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 7aa6051

Please sign in to comment.