Version Bump #6
This file contains hidden or 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: Version Bump | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "Version to bump to (e.g., 1.2.3)" | |
required: true | |
type: string | |
jobs: | |
version-bump: | |
name: Bump Version | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Validate version format | |
run: | | |
if [[ ! "${{ github.event.inputs.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$ ]]; then | |
echo "Error: Version must be in format x.y.z (e.g., 1.2.3) or x.y.z-rc.n (e.g., 1.2.3-rc.1)" | |
exit 1 | |
fi | |
- name: Update version in Cargo.toml | |
run: | | |
version="${{ github.event.inputs.version }}" | |
sed "s/^version = \".*\"\$/version = \"$version\"/" ./Cargo.toml > /tmp/cargo.toml | |
mv /tmp/cargo.toml ./Cargo.toml | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Cache Cargo | |
uses: Swatinem/rust-cache@v2 | |
- name: Update Cargo.lock | |
run: cargo check | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "chore(bump): Bump codemod crates version to v${{ github.event.inputs.version }}" | |
title: "chore(bump): Bump codemod crates version to v${{ github.event.inputs.version }}" | |
body: | | |
This PR bumps the codemod crates version to v${{ github.event.inputs.version }}. | |
Changes: | |
- Updated version in Cargo.toml | |
- Regenerated Cargo.lock | |
branch: "version-bump-codemod-crates-v${{ github.event.inputs.version }}" | |
delete-branch: true |