Skip to content
Merged
Show file tree
Hide file tree
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
37 changes: 16 additions & 21 deletions .github/workflows/release-plz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand All @@ -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: {}

Expand All @@ -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/*) ;;
Expand All @@ -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
Expand Down Expand Up @@ -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/*) ;;
Expand All @@ -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
Expand Down
18 changes: 10 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
-------------
Expand Down
Loading