Skip to content

version input in the Deploy workflow for TestPyPI#94

Merged
matyas-jirat-keboola merged 1 commit intomainfrom
pipeline-versioning-regression-fix
Mar 6, 2026
Merged

version input in the Deploy workflow for TestPyPI#94
matyas-jirat-keboola merged 1 commit intomainfrom
pipeline-versioning-regression-fix

Conversation

@soustruh
Copy link
Contributor

@soustruh soustruh commented Mar 5, 2026

What happened

  • The deploy workflow historically used two separate files: deploy.yml (production PyPI, on release) and deploy_to_test.yml (TestPyPI, manual workflow_dispatch)
  • Neither workflow supported setting the package version on manual runs — the version step was gated on if: github.ref_type == 'tag', which never matches for workflow_dispatch
  • At ae3e0fc, both files were merged into a single deploy.yml with a push: tags trigger — a transitional state during the workflow rework. The 1.7.x tags were created via Git CLI (git tag + git push) during this window
  • At 094e0b6 (1.7.3), the trigger was changed to workflow_dispatch (with an environment choice) + release: [published]. The environment input controlled which PyPI index to use but still didn't address versioning
  • At 4f76275, the environment input was replaced with a no-op note field
  • Net result: since 1.8.0, manual TestPyPI deploys have had no way to set the package version — they publish whatever is hardcoded in pyproject.toml

What this PR fixes

  • Adds a required version input to workflow_dispatch so manual TestPyPI deploys always have an explicit version
  • Updates the version replacement step to use inputs.version for manual runs, github.ref_name (tag) for releases
  • Resets pyproject.toml version to 0.0.0 placeholder to prevent accidental publishes with a stale version

Deploy flow after this change

  • Manual TestPyPI deploy: Go to Actions > "Build & Deploy to PyPI" > Run workflow, enter the desired version — publishes to TestPyPI only
  • Production release: Create a GitHub Release (with tag) — publishes to both TestPyPI and PyPI, version from tag
  • Kindly please use 1.9.x, 1.11.x etc. for TestPyPI and 1.10.x, 1.12.x etc. for production PyPI. New minor version lines should always start with 0 patch version (eg. test how long you want with 1.9.x, then use 1.10.0 for the actual release). Thanks! 🙏

@soustruh soustruh force-pushed the pipeline-versioning-regression-fix branch from 77a00a4 to 386cc48 Compare March 5, 2026 22:09
@soustruh soustruh requested a review from a team March 5, 2026 22:09
Copy link
Contributor

@matyas-jirat-keboola matyas-jirat-keboola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@matyas-jirat-keboola matyas-jirat-keboola merged commit 72e245f into main Mar 6, 2026
2 checks passed
@matyas-jirat-keboola matyas-jirat-keboola deleted the pipeline-versioning-regression-fix branch March 6, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants