-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (34 loc) · 992 Bytes
/
update-version-on-tag.yml
File metadata and controls
40 lines (34 loc) · 992 Bytes
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: Update VERSION.json on Tag
on:
push:
tags:
- 'v*'
jobs:
update-version:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
- name: Update VERSION.json
run: |
cat > VERSION.json << EOF
{
"version": "${{ steps.version.outputs.VERSION }}",
"buildDate": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
"commit": "${{ github.sha }}"
}
EOF
- name: Commit and push
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add VERSION.json
git commit -m "chore: bump version to ${{ steps.version.outputs.VERSION }}"
git push