Skip to content

Commit

Permalink
Update GitHub workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnittl committed Nov 2, 2021
1 parent f00bd35 commit ce4dcdb
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on:
push

jobs:
build-n-publish:
name: Build and publish to PyPI
build:
name: Build package
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -26,12 +26,30 @@ jobs:
- name: Build package
run: |
python -m build
- name: Upload dist files
uses: actions/upload-artifact@v2
with:
name: dist-files
path: dist/
if-no-files-found: error
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: build
steps:
- name: Download dist files
uses: actions/download-artifact@v2
with:
name: dist-files
path: dist/
- name: Publish package to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
- name: Publish package to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit ce4dcdb

Please sign in to comment.