Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 6 additions & 29 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ name: Upload Python Package
on:
release:
types: [ published ]
workflow_dispatch:
inputs:
version:
description: 'Version to use for this test run (no commit/push/tag/publish will actually happen)'
required: false
default: '0.0.0-test'

jobs:
bump-version:
Expand Down Expand Up @@ -39,11 +33,9 @@ jobs:

- name: Bump version
env:
INITIAL_TAG: ${{ github.event.release.tag_name || inputs.version }}
# TEMPORARY DRY-RUN OVERRIDE - forces test mode even for real releases.
# Original: ${{ github.event_name == 'workflow_dispatch' }}
# Revert this commit before running a real release.
IS_TEST_RUN: 'true'
# Passed via env, never interpolated into the script: a git tag name may legally contain
# ; $ ` & | ( ), so inlining it in the script would let a crafted release tag run commands.
INITIAL_TAG: ${{ github.event.release.tag_name }}
run: |
tag="${INITIAL_TAG//[v]/}"
echo "$tag"
Expand All @@ -55,20 +47,14 @@ jobs:
git config --global user.email "github-actions@github.com"
git config --global user.name "Github Actions"
echo "finished configuration"
bump-my-version bump --config-file .bump_version.toml --current-version 0.0.0 --new-version "$tag"
bump-my-version bump --config-file .bump_version.toml --current-version 0.0.0 --new-version $tag
echo "bumpversion finished"
auto-changelog
git add .
git commit -m "release $tag"
if [ "$IS_TEST_RUN" = "true" ]; then
echo "Test run: skipping git push"
else
git push
fi
git push

- name: Move tag
# TEMPORARY DRY-RUN OVERRIDE - original: github.event_name == 'release'
if: false
env:
TAG_NAME: ${{ github.event.release.tag_name }}
run: |
Expand Down Expand Up @@ -103,14 +89,5 @@ jobs:
run: python -m build

- name: Publish package to PyPI
# TEMPORARY DRY-RUN OVERRIDE - original: github.event_name == 'release'
if: false
uses: pypa/gh-action-pypi-publish@release/v1
# No user/password needed - OIDC handles authentication

- name: Validate package (dry run)
# TEMPORARY DRY-RUN OVERRIDE - original: github.event_name == 'workflow_dispatch'
if: true
run: |
pip install twine
twine check dist/*
# No user/password needed - OIDC handles authentication
Loading