Python package #8
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
# This workflow will install Python dependencies, run tests, lint, build, and upload your package. | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Python package | |
on: | |
workflow_run: | |
workflows: ["Build"] | |
types: | |
- completed | |
push: | |
tags: [ "*" ] # Trigger on any tag push | |
jobs: | |
publish: | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.10 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install twine | |
- name: Build package | |
run: | | |
python setup.py sdist bdist_wheel | |
- name: Publish package | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
run: | | |
twine upload dist/* |