-
Notifications
You must be signed in to change notification settings - Fork 5
38 lines (32 loc) · 966 Bytes
/
on_release.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
name: On Release
on:
release:
branches: [ "main" ]
types: [published, prereleased]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.TOKEN_FOR_ONCHANGE }}
- name: Update version.txt
run: |
echo "Version= ${GITHUB_REF_NAME}" > caper/version.txt
echo "Creator= ${GITHUB_ACTOR}" >> caper/version.txt
NOW=`date`
echo "Date= ${NOW}" >> caper/version.txt
COMMIT_ID=`git rev-parse HEAD`
echo "CommitID=${COMMIT_ID}" >> caper/version.txt
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Auto-Update version.txt on release
push_options: '--force'
branch: main
- name: move tag on version.txt to our updated one
run: |
git tag -f ${GITHUB_REF_NAME}
git push -f --tags