Skip to content

Commit

Permalink
Add prepare-release gh action that bump versions and create PR (#1492)
Browse files Browse the repository at this point in the history
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
panarch authored May 16, 2024
1 parent 4a64bf9 commit dcd8666
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/prepare-release.yml
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

0 comments on commit dcd8666

Please sign in to comment.