Skip to content

Commit 128f04b

Browse files
authored
ci: add release tag workflow (#245)
1 parent 0dc6f8f commit 128f04b

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/release-tag.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: 📜 Release | Tag
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
tag-release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Git
17+
run: |
18+
git config --global user.name 'github-actions[bot]'
19+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
20+
21+
- name: Get current version
22+
run: |
23+
version=$(./scripts/get-version.sh)
24+
echo "version=$version" >> $GITHUB_ENV
25+
26+
- name: Check if tag already exists
27+
run: |
28+
if git rev-parse "${{ env.version }}" >/dev/null 2>&1; then
29+
echo "Tag already exists."
30+
echo "exists=true" >> $GITHUB_ENV
31+
else
32+
echo "Tag does not exist."
33+
echo "exists=false" >> $GITHUB_ENV
34+
35+
- name: Create and push tag
36+
if: env.exists == 'false'
37+
run: |
38+
git tag -a "${{ env.version }}" -m "Release version ${{ env.version }}"
39+
git push origin "${{ env.version }}"

0 commit comments

Comments
 (0)