forked from GalaChain/sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (46 loc) · 1.62 KB
/
manual-version-bump.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: SDK Version bump
on:
workflow_dispatch:
inputs:
target_branch:
description: 'Target branch (main or main-v*)'
required: true
default: 'main'
jobs:
bump-version:
name: Bump SDK Version
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.target_branch }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install tools
run: npm i -g semver
- name: Configure Git
run: |
git config --global user.name "galachain-release-bot"
git config --global user.email "[email protected]"
- name: Set a new version
run: |
VERSION="$(semver "$(< package.json jq -r '.version')" -i)"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create a new branch
run: |
BRANCH_NAME="bump-version-to-$VERSION"
git checkout -b $BRANCH_NAME ${{ inputs.target_branch }}
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
- name: Bump version and commit changes
run: |
./unifyVersions.js $VERSION
npm i
git commit -am "Bump version to $VERSION"
git push --set-upstream origin bump-version-to-$VERSION
- name: Create Pull Request
env:
GH_TOKEN: ${{ secrets.RELEASE_BOT_TOKEN }}
run: gh pr create --title "Bump Version to $VERSION" --body "Bump Version to $VERSION" --label "bump-version-pr" --head "bump-version-to-$VERSION" --base ${{ inputs.target_branch }}