From 5d310373aa1d8c2ac323cd765f64195c612fcb3a Mon Sep 17 00:00:00 2001 From: Vitor Bandeira Date: Tue, 7 Apr 2026 12:33:10 -0300 Subject: [PATCH] ci: add gha for tag release Signed-off-by: Vitor Bandeira --- .../github-actions-quarterly-tag.yml | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/github-actions-quarterly-tag.yml diff --git a/.github/workflows/github-actions-quarterly-tag.yml b/.github/workflows/github-actions-quarterly-tag.yml new file mode 100644 index 0000000000..0f86a8d9aa --- /dev/null +++ b/.github/workflows/github-actions-quarterly-tag.yml @@ -0,0 +1,52 @@ +name: Quarterly Release Tag + +on: + schedule: + # Midnight UTC on the first day of each quarter (Jan, Apr, Jul, Oct) + - cron: '0 0 1 1,4,7,10 *' + workflow_dispatch: + +concurrency: + group: quarterly-tag + cancel-in-progress: false + +jobs: + create-tag: + name: Create quarterly tag + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Determine tag name + id: tag + run: | + month=$(date -u +%-m) + year=$(date -u +%y) + case $month in + 1|2|3) quarter=1 ;; + 4|5|6) quarter=2 ;; + 7|8|9) quarter=3 ;; + 10|11|12) quarter=4 ;; + esac + tag="${year}Q${quarter}" + echo "tag=$tag" >> "$GITHUB_OUTPUT" + echo "Quarterly tag: $tag" + + - name: Configure git user + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + - name: Create and push tag + env: + TAG: ${{ steps.tag.outputs.tag }} + run: | + if git ls-remote --tags origin "refs/tags/$TAG" | grep -q .; then + echo "Tag $TAG already exists, skipping." + exit 0 + fi + git tag --annotate "$TAG" -m "Quarterly release $TAG" + git push origin "$TAG"