Skip to content

Commit 008d8ea

Browse files
committed
Update release workflow: generate version from tag
1 parent 465341c commit 008d8ea

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

.github/workflows/release-scheduled.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,29 @@ on:
77
version:
88
description: "Version Number"
99
type: string
10+
push:
11+
tags:
12+
- v[0-9]+.[0-9]+.[0-9]+
1013
env:
1114
VERSION: 4.8
1215
jobs:
1316
version:
14-
if: ${{ github.event_name == 'schedule' }}
1517
runs-on: ubuntu-latest
1618
outputs:
17-
version: ${{ steps.version.outputs.version }}
19+
version: ${{ steps.version.outputs.version || steps.custom.outputs.version || steps.tag.outputs.version }}
1820
steps:
19-
- name: Log Version
20-
run: date +'%Y%m%d-%H%M'
2121
- name: Output Version
2222
id: version
23+
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.version == '' ) }}
2324
run: echo "version=$(date +'%Y%m%d-%H%M')" >> $GITHUB_OUTPUT
25+
- name: Output Custom Version
26+
id: custom
27+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.version != '' }}
28+
run: echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
29+
- name: Output Tag
30+
id: tag
31+
if: ${{ github.event_name == 'push' }}
32+
run: echo "version=$(echo ${GITHUB_REF#refs/*/} | sed -e 's/v//')" >> $GITHUB_OUTPUT
2433
test:
2534
strategy:
2635
matrix:

0 commit comments

Comments
 (0)