Skip to content

Commit 6338e7b

Browse files
authored
Update branch tags only when releases are made
Also use https://github.com/tj-actions/release-tagger instead of our own custom workflow code.
1 parent efcd934 commit 6338e7b

File tree

1 file changed

+12
-35
lines changed

1 file changed

+12
-35
lines changed
+12-35
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,18 @@
1-
name: Update Main Version
2-
run-name: Move ${{ github.event.inputs.major_version || 'latest branch tag' }} to ${{ github.event.inputs.target || github.sha }}
1+
name: Update release version
32

4-
on:
5-
push:
6-
tags:
7-
- 'v[0-9]+.**'
8-
workflow_dispatch:
9-
inputs:
10-
target:
11-
description: The tag or reference to use
12-
required: true
13-
major_version:
14-
type: choice
15-
description: The major version to update
16-
options:
17-
- v1
3+
permissions:
4+
contents: write
185

19-
env:
20-
MAJOR_VERSION: 'v1'
6+
on:
7+
release:
8+
types: [published]
219

2210
jobs:
23-
tag:
11+
update-version:
2412
runs-on: ubuntu-latest
25-
permissions:
26-
contents: write
2713
steps:
28-
- uses: actions/checkout@v4
29-
with:
30-
fetch-depth: 0
31-
- name: Git config
32-
run: |
33-
git config user.name github-actions
34-
git config user.email github-actions@github.com
35-
#- name: Get major version from tag name
36-
# if: ${{ github.event_name === 'push' }}
37-
# run: echo "MAJOR_VERSION=`echo ${GITHUB_REF#refs/*/} | cut -c1-2`" >> $GITHUB_ENV
38-
- name: Tag new target
39-
run: git tag -f ${{ github.event.inputs.major_version || env.MAJOR_VERSION }} ${{ github.event.inputs.target || github.sha }}
40-
- name: Push new tag
41-
run: git push origin ${{ github.event.inputs.major_version || env.MAJOR_VERSION }} --force
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
- name: Run release-tagger
18+
uses: tj-actions/release-tagger@v4

0 commit comments

Comments
 (0)