Build and Publish #4
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: Build and Publish | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.*' # Trigger on tags like v1.0, 2.3, etc. | |
permissions: | |
contents: read | |
jobs: | |
pypi-publish: | |
runs-on: ubuntu-latest | |
environment: release | |
permissions: | |
id-token: write | |
if: github.ref_type == 'tag' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel | |
- name: Build Python Package | |
run: python setup.py sdist bdist_wheel | |
- name: Publish Python Package | |
uses: pypa/gh-action-pypi-publish@release/v1 |