File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change
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 }}"
You can’t perform that action at this time.
0 commit comments