This repository has been archived by the owner on Jul 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (58 loc) · 2.08 KB
/
tag.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
62
63
64
65
66
67
68
name: Tag Branches With New Version
run-name: Tag Branches With New Version
on:
pull_request_target:
types:
- closed
branches:
- 'mps/2021.3'
# allow manual execution just in case
workflow_dispatch:
jobs:
tagBranches:
# only trigger if the PR was actually merged or is manually triggered
if: ( github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' )
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{secrets.MPS_REPO_PAT}}
ref: '${{ github.ref_name }}'
fetch-depth: 0
- name: Calculate next patch number
run: |
lastVersion=$(git tag | grep "^2020.3\.[0-9]*$" | sort -V | tail -n1 | cut -d . -f 3)
nextVersion=$((lastVersion+1))
echo "nextVersion=$nextVersion" >> $GITHUB_ENV
- name: Tag 2020.3 with new version
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.MPS_REPO_PAT }}
CUSTOM_TAG: 2020.3.${{ env.nextVersion }}
DEFAULT_BRANCH: mps/2020.3
- name: Switch to branch mps/2021.1
run: git switch mps/2021.1
- name: Tag 2021.1 with new version
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.MPS_REPO_PAT }}
CUSTOM_TAG: 2021.1.${{ env.nextVersion }}
DEFAULT_BRANCH: mps/2021.1
- name: Switch to branch mps/2021.2
run: git switch mps/2021.2
- name: Tag 2021.2 with new version
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.MPS_REPO_PAT }}
CUSTOM_TAG: 2021.2.${{ env.nextVersion }}
DEFAULT_BRANCH: mps/2021.2
- name: Switch to branch mps/2021.3
run: git switch mps/2021.3
- name: Tag 2021.3 with new version
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.MPS_REPO_PAT }}
CUSTOM_TAG: 2021.3.${{ env.nextVersion }}
DEFAULT_BRANCH: mps/2021.3