-
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (51 loc) · 1.74 KB
/
update-major-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: Update Major Version
run-name: Update for ${{ github.event.release.tag_name }}
on:
release:
types:
- released
tags-ignore:
- v1.*
- v2.*
- v3.*
- v4.*
- 1.*
- 2.*
- 3.*
- 4.*
workflow_dispatch:
inputs:
target:
description: The tag or reference to use
required: true
major_version:
type: choice
description: The major version to update
options:
- "5"
permissions: write-all
jobs:
tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Git config
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Get versions
id: version
run: |
TAG=${{ github.event.release.tag_name }}
echo "full_version=${TAG}" >> $GITHUB_OUTPUT
echo "major_version=v${TAG:0:1}" >> $GITHUB_OUTPUT
- name: Show versions
run: |
echo "Major is ${{ steps.version.outputs.major_version }}"
echo "Full is ${{ steps.version.outputs.full_version }}"
- name: Tag new target
run: git tag -f "${{ steps.version.outputs.major_version }}" "${{ steps.version.outputs.full_version }}"
- name: Push new tag
run: git push origin "${{ steps.version.outputs.major_version }}" --force