Only run one build workflow concurrently #9
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 Python Package | ||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.7' | ||
- name: Install build tools | ||
run: | | ||
python3 -m pip install --upgrade pip --force | ||
pip3 install -U setuptools | ||
pip3 install build twine wheel | ||
pip3 install -U pkginfo | ||
- name: Build the package | ||
run: python3 -m build | ||
- name: List files | ||
run: | | ||
ls | ||
- name: Upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: | ||
publish: | ||
- name: Publish to PyPI | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: twine upload dist/* |