Skip to content

Commit a3552ef

Browse files
committed
Calculate options from version
1 parent 7dde579 commit a3552ef

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
# The project uses PEP 440 version scheme with N.N.N release segment,
7+
# {a,b,rc}N pre-release segment and .postN post-release segment
8+
- "[0-9]+.[0-9]+.[0-9]+[ab][0-9]+"
9+
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
10+
- "[0-9]+.[0-9]+.[0-9]+"
11+
- "[0-9]+.[0-9]+.[0-9]+.post[0-9]+"
12+
workflow_dispatch:
13+
inputs:
14+
version:
15+
required: true
16+
type: string
17+
18+
env:
19+
VERSION: ${{ case(github.event_name == 'workflow_dispatch', inputs.version, github.ref_name) }}
20+
PRERELEASE: ${{ contains(env.VERSION, 'a') || contains(env.VERSION, 'b') || contains(env.VERSION, 'rc') }}
21+
LATEST: ${{ !env.PRERELEASE }}
22+
23+
jobs:
24+
report:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- run: |
28+
echo version: $VERSION
29+
echo is pre-release: $PRERELEASE
30+
echo is latest: $LATEST

0 commit comments

Comments
 (0)