-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (33 loc) · 935 Bytes
/
tag-version.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Tag Version
on:
push:
branches:
- main
paths:
- 'packages/meta/version.go'
jobs:
tag:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
- 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: Extract VERSION
id: extract_version
run: |
VERSION=$(grep -oP 'VERSION\s*=\s*"\K[^"]+' packages/meta/version.go)
echo "VERSION=$VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create Git tag
run: |
git tag -a "v$VERSION" -m "Release version $VERSION"
- name: Push Git tag
env:
GH_PAT: ${{ secrets.GH_PAT }}
run: |
git push --tags