File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed
Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Bump version
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ level :
7+ description : Version bump level
8+ required : true
9+ type : choice
10+ default : patch
11+ options :
12+ - patch
13+ - minor
14+ - major
15+
16+ permissions :
17+ contents : write
18+
19+ jobs :
20+ bump-version :
21+ runs-on : ubuntu-latest
22+ steps :
23+ - name : Checkout
24+ uses : actions/checkout@v4
25+
26+ - name : Cache dependencies
27+ uses : actions/setup-node@v4
28+ with :
29+ node-version : 20
30+ cache : " yarn"
31+ registry-url : " https://npm.pkg.github.com"
32+ scope : " @RaspberryPiFoundation"
33+
34+ - name : Configure git
35+ run : |
36+ git config user.name "github-actions[bot]"
37+ git config user.email "github-actions[bot]@users.noreply.github.com"
38+
39+ - name : Bump version
40+ run : yarn version ${{ inputs.level }}
41+
42+ - name : Commit and push
43+ run : |
44+ if git diff --quiet; then
45+ echo "No changes to commit"
46+ exit 1
47+ fi
48+
49+ git add -A
50+ git commit -m "Bump version (${{ inputs.level }}) for release"
51+ git push origin HEAD:${{ github.ref_name }}
You can’t perform that action at this time.
0 commit comments