Adjust release tag trigger #57
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: Python package | |
on: | |
push: | |
tags: | |
- v* | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
BuildDocs: | |
name: Build Docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Setup UV | |
run: pip install uv | |
- name: Execute Tests | |
run: make docs-build | |
UnitTests: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Setup UV | |
run: pip install uv | |
- name: Execute Tests | |
run: make test-all | |
StaticChecks: | |
name: Static Checks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Setup UV | |
run: pip install uv | |
- name: Execute Static Checks | |
run: make lint | |
BuildPackage: | |
name: Static Checks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Setup UV | |
run: pip install uv | |
- name: Execute Static Checks | |
run: make build | |
Publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
needs: [UnitTests, StaticChecks, BuildDocs, BuildPackage] | |
environment: | |
name: pypi | |
url: https://pypi.org/p/gyjd | |
permissions: | |
id-token: write | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Setup UV | |
run: pip install uv | |
- name: Build package | |
run: make build | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |