-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add prepare-release gh action that bump versions and create PR (#1492)
This is a starting action to prepare the new release. It’s all about keeping things simple: manually triggered, bumps versions, and creates a PR ready for the next steps.
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Prepare Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Version number or step to bump' | ||
required: true | ||
default: 'minor' | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
bump_version: | ||
name: Bump versions | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: Swatinem/rust-cache@v2 | ||
- uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-release | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- name: Bump versions | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
cargo release version ${{ github.event.inputs.version }} --workspace --execute --no-confirm | ||
cd pkg/javascript | ||
NEW_VERSION=$(npm version ${{ github.event.inputs.version }}>&1) | ||
cd ../../ | ||
NEW_BRANCH="prepare-release-$NEW_VERSION" | ||
git checkout -b $NEW_BRANCH | ||
git config --local user.email "taehoon.moon@outlook.com" | ||
git config --local user.name "Taehoon Moon" | ||
git add . | ||
git commit -m "Bump version to $NEW_VERSION" | ||
git push origin $NEW_BRANCH | ||
gh pr create --draft --title "Prepare release $NEW_VERSION" --body "Prepare release $NEW_VERSION" --repo $GITHUB_REPOSITORY |