-
Notifications
You must be signed in to change notification settings - Fork 200
41 lines (40 loc) · 1.37 KB
/
versioner.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
#############################################################################
# GitHub Action to bump build number
#
#############################################################################
name: "Bump build number on OS branch push"
on:
push:
branches:
- 'dev_sonoma_compscript'
# - '!dev*'
# - '!main'
jobs:
bump:
name: Bump build
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Update VERSION.yaml with newest build number
id: new_build
run: |
CURRENT_BUILD=$(awk '/^build/ { print $NF }' VERSION.yaml)
if [[ -z $CURRENT_BUILD ]];then
echo "build: 1" >> VERSION.yaml
echo "::set-output name=NEWBUILD::1"
else
NEW_BUILD=$((CURRENT_BUILD+1))
echo "$NEW_BUILD"
echo "::set-output name=NEWBUILD::$NEW_BUILD"
sed -i "s/^build.*/build: $NEW_BUILD/" VERSION.yaml
fi
- name: Push commit
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add VERSION.yaml
git commit -am "minor: Bump build to ${{ steps.new_build.outputs.NEWBUILD }}"
git push