-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dan Brodjieski
committed
May 21, 2024
1 parent
1271274
commit e80bd05
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |