-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (37 loc) · 1.21 KB
/
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
name: 'Bump Version'
on:
workflow_dispatch:
inputs:
bump-mode:
description: 'Select bump mode'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
jobs:
bump-version:
name: 'Bump Version on master'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: 'Checkout source code'
uses: actions/checkout@v4
- name: 'Checkout version-bump branch'
run: |
git fetch origin version-bump && git checkout version-bump || git checkout -b version-bump
- name: Print Current Branch
run: echo "$(git branch --show-current)"
- name: 'print current version'
run: npm pkg get version
- name: Bump SDK version and commit to version-bump branch
run: |
git config user.name $GITHUB_ACTOR
git config user.email ${GITHUB_ACTOR}@users.noreply.github.com
npm version ${{ inputs.bump-mode }} -m "update package to version %s [skip ci]"
git push "https://$GITHUB_ACTOR:$TOKEN@github.com/$GITHUB_REPOSITORY.git"
- name: 'print updated version'
run: npm pkg get version