Skip to content

Commit

Permalink
ci: add release tag workflow (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
mailo-nr authored Feb 24, 2025
1 parent 0dc6f8f commit 128f04b
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/release-tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 📜 Release | Tag

on:
push:
branches:
- main

jobs:
tag-release:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Get current version
run: |
version=$(./scripts/get-version.sh)
echo "version=$version" >> $GITHUB_ENV
- name: Check if tag already exists
run: |
if git rev-parse "${{ env.version }}" >/dev/null 2>&1; then
echo "Tag already exists."
echo "exists=true" >> $GITHUB_ENV
else
echo "Tag does not exist."
echo "exists=false" >> $GITHUB_ENV
- name: Create and push tag
if: env.exists == 'false'
run: |
git tag -a "${{ env.version }}" -m "Release version ${{ env.version }}"
git push origin "${{ env.version }}"

0 comments on commit 128f04b

Please sign in to comment.