Skip to content

Commit

Permalink
Updated PyPI publish workflow (#4)
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Lehr <[email protected]>
  • Loading branch information
timlehr authored Jul 7, 2023
1 parent 1286799 commit b6c33ae
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/deploy_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,27 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip build twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
# You need to add a token to your repo's secrets
# Make sure you match the name of your secret to the token name below.
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
python -m pip install build
- name: Build dist package
run: |
python -m build
- name: Upload Built Artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: |
./dist/*.whl
./dist/*.gz
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

# Make sure everything works on testpypi before releasing on pypi
twine upload --repository pypi dist/*

0 comments on commit b6c33ae

Please sign in to comment.