From 313ac6cbfae3eb8cbf9c054da1559f26ae7ca48d Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Thu, 10 Sep 2026 16:39:01 -0500 Subject: [PATCH] ci: use the workflow_dispatch branch as the release-plz release branch Drop the redundant `branch` input and release from the branch selected in the "Run workflow" dropdown (github.ref_name), matching how swift-release.yml already works. Co-Authored-by: kimi-k3 --- .github/workflows/release-plz.yml | 37 +++++++++++++------------------ CONTRIBUTING.md | 18 ++++++++------- 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml index a884e77..9e86318 100644 --- a/.github/workflows/release-plz.yml +++ b/.github/workflows/release-plz.yml @@ -3,14 +3,14 @@ name: Release-plz # How this works (see https://release-plz.dev/docs/github/quickstart): # # This workflow is triggered manually only (Actions -> "Release-plz" -> "Run -# workflow") and takes two inputs: -# - command: `release-pr` to prepare/refresh the release PR, `release` to -# publish after the release PR has been merged. -# - branch: the branch to release from, e.g. `master` or `release/1.0`. +# workflow"). Select the branch to release from in the "Use workflow from" +# dropdown (e.g. `master` or `release/1.0`) and choose the command: +# - `release-pr` to prepare/refresh the release PR. +# - `release` to publish after the release PR has been merged. # # 1. `release-pr` opens/updates a release PR (branch prefix `release-plz-`) # with the version bump and changelog for the `rust-cktap` crate, targeting -# the given branch, authored by the `bitcoindevkit-release-plz` GitHub App. +# the selected branch, authored by the `bitcoindevkit-release-plz` GitHub App. # The version bump is computed from that branch's Cargo.toml. Re-run it to # refresh the release PR after new commits land on the branch. # 2. After the release PR is reviewed and merged, run the workflow again with @@ -22,10 +22,10 @@ name: Release-plz # waits until a team member approves it in the Actions UI. # # Notes: -# - To release from a `release/*` maintenance branch, `release-plz.toml` must -# exist on that branch (cherry-pick it when cutting the branch). This -# workflow file only needs to exist on the ref you select in the "Use -# workflow from" dropdown of the dispatch form (usually `master`). +# - To release from a `release/*` maintenance branch, cherry-pick both +# `release-plz.toml` and this workflow file onto that branch when cutting it +# (and keep the workflow in sync with `master` afterwards): the run uses the +# workflow file from the branch selected in the dropdown. # - release-plz supports only one open release PR per repository, so don't # prepare releases on two branches concurrently. @@ -41,11 +41,6 @@ on: options: - release-pr - release - branch: - description: Branch to release from (master or release/*) - required: true - type: string - default: master permissions: {} @@ -59,12 +54,12 @@ jobs: contents: write # push the release PR branch pull-requests: write # open and update the release PR concurrency: - group: release-plz-${{ inputs.branch }} + group: release-plz-${{ github.ref_name }} cancel-in-progress: false steps: - - name: Validate branch input + - name: Validate selected branch env: - BRANCH: ${{ inputs.branch }} + BRANCH: ${{ github.ref_name }} run: | case "$BRANCH" in master|release/*) ;; @@ -79,7 +74,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: - ref: ${{ inputs.branch }} + ref: ${{ github.ref_name }} fetch-depth: 0 persist-credentials: false - name: Install Rust toolchain @@ -107,9 +102,9 @@ jobs: pull-requests: read # detect the merged release PR id-token: write # crates.io trusted publishing (OIDC) steps: - - name: Validate branch input + - name: Validate selected branch env: - BRANCH: ${{ inputs.branch }} + BRANCH: ${{ github.ref_name }} run: | case "$BRANCH" in master|release/*) ;; @@ -124,7 +119,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: - ref: ${{ inputs.branch }} + ref: ${{ github.ref_name }} fetch-depth: 0 persist-credentials: false - name: Install Rust toolchain diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 939fa16..bdbc814 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -117,10 +117,11 @@ excluded (they cannot be published to crates.io). 1. Commits must follow [conventional commits](https://www.conventionalcommits.org) (e.g. `feat:`, `fix:`, `fix!:`) so the changelog is generated correctly. 2. To prepare a release, run the `Release-plz` workflow manually from the - Actions tab with command `release-pr` and the branch to release from - (`master` or a `release/*` branch). The `bitcoindevkit-release-plz` GitHub - App opens or updates a release PR targeting that branch with the version - bump and changelog. Re-run it to refresh the PR after new commits land. + Actions tab: select the branch to release from (`master` or a `release/*` + branch) in the "Run workflow" dropdown and choose the `release-pr` command. + The `bitcoindevkit-release-plz` GitHub App opens or updates a release PR + targeting that branch with the version bump and changelog. Re-run it to + refresh the PR after new commits land. 3. A maintainer reviews and merges the release PR. 4. Run the `Release-plz` workflow again with command `release` on the same branch. The job waits for approval from a member of the @@ -132,10 +133,11 @@ The plain `vX.Y.Z` tag namespace is reserved for Swift package releases (see `.github/workflows/swift-release.yml`). To cut a maintenance release from a `release/*` branch (e.g. backporting a fix -to a prior major version), cherry-pick `release-plz.toml` onto the branch when -creating it, then use the workflow's branch input. Don't prepare releases on -two branches concurrently — release-plz supports only one open release PR per -repository. +to a prior major version), cherry-pick `release-plz.toml` and +`.github/workflows/release-plz.yml` onto the branch when creating it (the run +uses the workflow file from the branch selected in the dropdown), then select +that branch when running the workflow. Don't prepare releases on two branches +concurrently — release-plz supports only one open release PR per repository. Going further -------------