Created
October 20, 2022 18:50
-
-
Save aChase55/bf057f9c2c4469530b04a0e7b636dd30 to your computer and use it in GitHub Desktop.
Tag builds
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
name: Tag Builds | |
on: | |
workflow_call: | |
jobs: | |
tag-builds: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.CI_BOT_ACCESS_TOKEN }} | |
- name: Get next build tag | |
id: get-next-build-tag | |
run: | | |
VERSION_NUMBER=`cat Whatnot.xcodeproj/project.pbxproj | grep 'WN_VERSION_NUMBER =' | tail -n 1 | awk -F'[ ; ]' '{print $3}'` | |
LAST_BUILD=`git tag | grep ^$VERSION_NUMBER | sort -V | tail -n 1 | awk -F"-" '{print $2}'` | |
RELEASE_BUILD=$((LAST_BUILD + 1)) | |
NEW_TAG_RELEASE="$VERSION_NUMBER-$RELEASE_BUILD-Release" | |
DEBUG_BUILD=$((RELEASE_BUILD + 1)) | |
NEW_TAG_DEBUG="$VERSION_NUMBER-$DEBUG_BUILD-Debug" | |
git tag $NEW_TAG_RELEASE | |
git push origin --tags | |
sleep 5m | |
git tag $NEW_TAG_DEBUG | |
git push origin --tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment