Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prepare-release gh action that bump versions and create PR #1492

Merged
merged 1 commit into from
May 16, 2024
Merged
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
Add prepare-release gh action that bump versions and create PR
  • Loading branch information
panarch committed May 16, 2024
commit dc21d7dafee4ec20c60b1779aaed77838f8fefc5
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
Loading