Added auto-tagging workflow

This commit is contained in:
Christian Tosta
2025-04-18 10:51:42 -03:00
parent 47529209d4
commit a008f27813

40
.github/workflows/auto-tag.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: auto-tag
on:
push:
schedule:
- cron: '30 3 * * *'
jobs:
create-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install cmake g++ gcc
- name: Set environment
run: |
cmake --fresh -B build -S .
echo "NEW_TAG=v$(cat build/version)" >> $GITHUB_ENV
- name: Check if package version has corresponding git tag
id: tagged
shell: bash
run: |
git show-ref \
--tags --verify --quiet -- \
"refs/tags/${NEW_TAG}" \
&& echo tagged=1 >> $GITHUB_OUTPUT \
|| echo tagged=0 >> $GITHUB_OUTPUT
- name: Create new tag
if: steps.tagged.outputs.tagged == 0
run: |
git tag ${NEW_TAG} \
&& git push origin ${NEW_TAG}) \
|| exit 0