From 8d12b29ce117eda2b35535f9023becc2c80459b9 Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Tue, 2 Sep 2025 09:11:14 -0700 Subject: [PATCH 1/2] chore: allow release workflow to be manually run and skip pypi upload This makes it possible to manually invoke the release workflow and skip the pypi upload. This is useful if the release workflow was cancelled (or failed) after the pypi upload step. --- .github/workflows/release.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e13ab97fb6..7a25c6eca0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,6 +19,13 @@ on: push: tags: - "*.*.*" + workflow_dispatch: + inputs: + publish_to_pypi: + description: 'Publish to PyPI' + required: true + type: boolean + default: true jobs: build: @@ -29,6 +36,7 @@ jobs: - name: Create release archive and notes run: .github/workflows/create_archive_and_notes.sh - name: Publish wheel dist + if: github.event_name == 'push' || github.event.inputs.publish_to_pypi env: # This special value tells pypi that the user identity is supplied within the token TWINE_USERNAME: __token__ From e26bc8e4fe7575be4bb9a1f9c071aac041e22ca8 Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Tue, 2 Sep 2025 09:49:11 -0700 Subject: [PATCH 2/2] add docs --- RELEASING.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/RELEASING.md b/RELEASING.md index e72ff619ba..3d58a9339e 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -45,6 +45,25 @@ final release (`X.Y.Z`). Release automation will create a GitHub release and BCR pull request. +### Manually triggering the release workflow + +The release workflow can be manually triggered using the GitHub CLI (`gh`). +This is useful for re-running a release or for creating a release from a +specific commit. + +To trigger the workflow, use the `gh workflow run` command: + +```shell +gh workflow run release.yml --ref +``` + +By default, the workflow will publish the wheel to PyPI. To skip this step, +you can set the `publish_to_pypi` input to `false`: + +```shell +gh workflow run release.yml --ref -f publish_to_pypi=false +``` + ### Determining Semantic Version **rules_python** uses [semantic version](https://semver.org), so releases with