From 5173991c129491a88451c87001f95514f8591a4a Mon Sep 17 00:00:00 2001 From: Peter Corke Date: Tue, 24 Nov 2026 08:44:33 +1000 Subject: [PATCH] ci: add a dry_run input to the release workflow A manual run with dry_run ticked builds the sdist and wheel and smoke-tests the wheel, but skips the PyPI upload, so the release path can be checked without a release. A release event is unchanged: it always publishes. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/release.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 069b69ee..27837533 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,9 @@ # Build and publish to PyPI on GitHub release creation or manual trigger. # Uses OIDC trusted publishing — no stored PyPI token required. # Pure Python package — a universal wheel suffices; no cibuildwheel needed. +# +# A manual run with dry_run ticked builds the sdist and wheel and smoke-tests the +# wheel, but does not publish to PyPI. Use it to check the release path. name: Release @@ -8,6 +11,11 @@ on: release: types: [created] workflow_dispatch: + inputs: + dry_run: + description: "Dry run: build and smoke-test, but do not publish to PyPI" + type: boolean + default: false env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true @@ -67,9 +75,16 @@ jobs: - name: Smoke test run: python -c "import machinevisiontoolbox; print('OK', machinevisiontoolbox.__version__)" + - name: Note a dry run + if: github.event_name == 'workflow_dispatch' && inputs.dry_run + run: | + echo "Dry run. The wheel built and passed the smoke test; nothing is published to PyPI." >> "$GITHUB_STEP_SUMMARY" + upload_pypi: name: Publish to PyPI needs: [build, smoke_test] + # skipped on a dry run; a release event has no inputs, so it always publishes + if: github.event_name != 'workflow_dispatch' || !inputs.dry_run runs-on: ubuntu-latest environment: pypi permissions: