refactor: updated workflow to env files #2
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
############################################################################# | |
# 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 "NEWBUILD=1" >> $GITHUB_OUTPUT | |
else | |
NEW_BUILD=$((CURRENT_BUILD+1)) | |
echo "$NEW_BUILD" | |
echo "NEWBUID=$NEW_BUILD" >> $GITHUB_OUTPUT | |
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 |