Skip to content

Instantly share code, notes, and snippets.

@aChase55
Created October 20, 2022 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aChase55/bf057f9c2c4469530b04a0e7b636dd30 to your computer and use it in GitHub Desktop.
Save aChase55/bf057f9c2c4469530b04a0e7b636dd30 to your computer and use it in GitHub Desktop.
Tag builds
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