Open a Rust release PR #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Open a Rust release PR | |
on: | |
workflow_dispatch: | |
inputs: | |
crate: | |
description: Crate to release | |
required: true | |
type: choice | |
options: | |
- all | |
- aligned-sized | |
- light-heap | |
- light-utils | |
- light-bounded-vec | |
- light-hasher | |
- light-macros | |
- light-hash-set | |
- light-merkle-tree-reference | |
- light-concurrent-merkle-tree | |
- light-indexed-merkle-tree | |
- light-circuitlib-rs | |
- light-verifier | |
- account-compression | |
- light-registry | |
- light-system-program | |
- light-compressed-token | |
- light-test-utils | |
- light-wasm-hasher | |
version: | |
description: Version to release | |
required: true | |
type: choice | |
options: | |
- major | |
- minor | |
- patch | |
- release | |
- rc | |
- beta | |
- alpha | |
jobs: | |
make-release-pr: | |
permissions: | |
id-token: write | |
pull-requests: write | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: chainguard-dev/actions/setup-gitsign@main | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
- name: Install cargo-release | |
shell: bash | |
run: | | |
VERSION="$(curl --silent "https://api.github.com/repos/crate-ci/cargo-release/releases/latest" | jq -r .tag_name)" | |
pushd /tmp | |
wget https://github.com/crate-ci/cargo-release/releases/download/"$VERSION"/cargo-release-"$VERSION"-x86_64-unknown-linux-gnu.tar.gz | |
tar -xzvf cargo-release-"$VERSION"-x86_64-unknown-linux-gnu.tar.gz --wildcards '*cargo-release' --strip-components=1 | |
cp cargo-release "$HOME"/.cargo/bin | |
popd | |
- name: Bump all crate versions | |
if: inputs.crate == 'all' | |
run: | | |
cargo release version --execute --no-confirm \ | |
"${{ inputs.version }}" | |
- name: Bump crate version | |
if: inputs.crate != 'all' | |
run: | | |
cargo release version --execute --no-confirm \ | |
-p "${{ inputs.crate }}" "${{ inputs.version }}" | |
- name: Setup pnpm | |
uses: pnpm/[email protected] | |
with: | |
version: 8 | |
run_install: false | |
- name: Setup and build nocheck | |
uses: ./.github/actions/setup-and-build-nocheck | |
- name: Commit IDL and other changes | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email "[email protected]" | |
git add -A | |
git commit -m "Include IDL and other changes post build" | |
- name: Create pull request for all crates | |
if: inputs.crate == 'all' | |
uses: peter-evans/create-pull-request@v6 | |
env: | |
COMMIT_MESSAGE: "chore: Bump version of all Rust projects" | |
with: | |
commit-message: ${{ env.COMMIT_MESSAGE }} | |
title: ${{ env.COMMIT_MESSAGE }} | |
branch: "bump-all-rust" | |
labels: "version bump" | |
- name: Create pull request for crate | |
if: inputs.crate != 'all' | |
uses: peter-evans/create-pull-request@v6 | |
env: | |
COMMIT_MESSAGE: "chore: Bump version of Rust project ${{ inputs.crate }}" | |
with: | |
commit-message: ${{ env.COMMIT_MESSAGE }} | |
title: ${{ env.COMMIT_MESSAGE }} | |
branch: "bump-${{ inputs.crate }}" | |
labels: "version bump" |