Skip to content

Merge pull request #9 from StackOneHQ/refactor/single-binary #9

Merge pull request #9 from StackOneHQ/refactor/single-binary

Merge pull request #9 from StackOneHQ/refactor/single-binary #9

Workflow file for this run

name: Auto Tag on Merge
on:
push:
branches:
- main
jobs:
tag:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Read version from Info.plist
id: version
run: |
VERSION=$(grep -A1 'CFBundleShortVersionString' notifier/Info.plist \
| tail -1 | sed 's/.*<string>\(.*\)<\/string>.*/\1/' | tr -d '[:space:]')
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Check if tag already exists
id: tag_check
run: |
if git ls-remote --tags origin "refs/tags/v${{ steps.version.outputs.version }}" | grep -q .; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
- name: Create and push tag
if: steps.tag_check.outputs.exists == 'false'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag "v${{ steps.version.outputs.version }}"
git push origin "v${{ steps.version.outputs.version }}"