Skip to content

Commit

Permalink
Updated PyPI publish workflow (#5)
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Christophe Morin <jcmorin@anaconda.com>
  • Loading branch information
JeanChristopheMorinPerso authored Jul 7, 2023
1 parent eaa0b6f commit cad693f
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/deploy_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,26 @@ 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
# Make sure everything works on testpypi before releasing on pypi
twine upload --repository pypi dist/*
- 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

0 comments on commit cad693f

Please sign in to comment.