v0.10.1 #48
Workflow file for this run
This file contains hidden or 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: | |
release: | |
branches: [main] | |
types: [published] | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
attestations: write | |
jobs: | |
publish: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
# use fetch --all for setuptools_scm to work | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Build wheel | |
run: | | |
# Install dependencies | |
python -m pip install --upgrade pip twine | |
# Build wheel | |
python -m pip wheel -w dist . | |
# Check distribution | |
twine check dist/commit_check* | |
- name: Create attestations | |
uses: actions/attest-build-provenance@v2 | |
with: | |
subject-path: "dist/commit_check*" | |
- name: Publish package to TestPyPI | |
if: github.event_name == 'workflow_dispatch' && github.repository == 'commit-check/commit-check' | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }} | |
run: twine upload --repository testpypi dist/commit_check* | |
continue-on-error: true | |
- name: Publish package to PyPI | |
if: github.event_name != 'workflow_dispatch' && github.repository == 'commit-check/commit-check' | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
run: twine upload dist/commit_check* |