0.4.1 #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Package | |
on: | |
# Only run when release is created in the master branch | |
release: | |
types: [created] | |
branches: | |
- 'master' | |
jobs: | |
build: | |
name: Build distributable files | |
runs-on: 'ubuntu-latest' | |
steps: | |
- name: 'Checkout source repository' | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
- name: Install build dependencies | |
run: pip install build twine | |
- name: 'Build package' | |
run: scripts/build.sh | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
path: 'dist/*' | |
upload_pypi: | |
name: Upload packages | |
needs: ['build'] | |
runs-on: 'ubuntu-latest' | |
if: github.event_name == 'release' && github.event.action == 'created' | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: artifact | |
path: dist | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: '__token__' | |
password: '${{ secrets.PYPI_API_TOKEN }}' |