-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.8 KB
/
set-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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Prepare Release Tag
on:
push:
tags:
- "prep-[0-9]+.[0-9]+.[0-9]+"
jobs:
build:
name: Prepare Release Tag
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: master
token: ${{ secrets.PAT }}
- name: Split version
id: split_version
run: |
export plain_tag=$(TAG_NAME=${{ github.ref_name }}; echo "$TAG_NAME" | cut -d "-" -f 2)
echo "version=${plain_tag}" >> $GITHUB_OUTPUT
- name: Set version
run: ./scripts/set-version.sh ${{ steps.split_version.outputs.version }}
- name: Commit new version
id: auto_commit_action
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: master
- name: Generate a changelog
uses: orhun/git-cliff-action@v3
id: git_cliff
with:
config: cliff.toml
args: latest..${{ steps.auto_commit_action.outputs.commit_hash }} --tag v${{ steps.split_version.outputs.version }}
- name: Create release tag
uses: rickstaa/action-create-tag@v1
id: "tag_create"
with:
tag: "v${{ steps.split_version.outputs.version }}"
tag_exists_error: false
message: "${{ steps.git_cliff.outputs.content }}"
github_token: ${{ secrets.PAT }}
commit_sha: ${{ steps.auto_commit_action.outputs.commit_hash }}
- name: Recreate latest tag
uses: rickstaa/action-create-tag@v1
id: "re_tag_create"
with:
tag: "latest"
tag_exists_error: false
force_push_tag: true
message: "${{ steps.git_cliff.outputs.content }}"
github_token: ${{ secrets.PAT }}
commit_sha: ${{ steps.auto_commit_action.outputs.commit_hash }}