File tree Expand file tree Collapse file tree 2 files changed +21
-45
lines changed Expand file tree Collapse file tree 2 files changed +21
-45
lines changed Original file line number Diff line number Diff line change 4
4
push :
5
5
tags :
6
6
- " v[0-9]+.[0-9]+.[0-9]+"
7
+ workflow_dispatch :
8
+ inputs :
9
+ branch :
10
+ description : Branch that contains the release
11
+ required : true
12
+ type : string
7
13
8
14
jobs :
9
15
publish :
13
19
id-token : write
14
20
steps :
15
21
- uses : actions/checkout@v3
22
+ if : github.event_name == 'push'
23
+
24
+ - uses : actions/checkout@v3
25
+ if : github.event_name == 'workflow_dispatch'
26
+ with :
27
+ ref : ${{ inputs.branch }}
16
28
17
29
- name : Install Poetry
18
30
run : pipx install poetry==1.8.3
@@ -23,13 +35,22 @@ jobs:
23
35
poetry install --all-extras
24
36
25
37
- name : Check package version matches tag
38
+ if : github.event_name == 'push'
26
39
run : |
27
40
TAG_VERSION=${GITHUB_REF#refs/tags/v}
28
41
PACKAGE_VERSION=$(poetry version -s)
29
42
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
30
43
echo "Error: Tag version ($TAG_VERSION) does not match package version ($PACKAGE_VERSION)"
31
44
exit 1
32
45
fi
46
+ - name : Check that version is alpha version
47
+ if : github.event_name == 'workflow_dispatch'
48
+ run : |
49
+ PACKAGE_VERSION=$(poetry version -s)
50
+ if [[ ! "$PACKAGE_VERSION" =~ .*a[0-9]+$ ]]; then
51
+ echo "Error: Package version ($PACKAGE_VERSION) is not an alpha version (should end with 'aN' where N is a number)"
52
+ exit 1
53
+ fi
33
54
34
55
- name : Build Python package
35
56
run : poetry build
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments