File tree Expand file tree Collapse file tree 1 file changed +29
-5
lines changed Expand file tree Collapse file tree 1 file changed +29
-5
lines changed Original file line number Diff line number Diff line change @@ -3,14 +3,38 @@ name: Publish Package to PyPI and TestPyPI
3
3
on :
4
4
workflow_dispatch :
5
5
push :
6
- tags :
7
- - ' *'
6
+ paths :
7
+ - pyproject.toml
8
+
9
+ jobs :
10
+ create-tag :
11
+ name : Create tag from new version
12
+ runs-on : " ubuntu-latest"
13
+ needs :
14
+ - build
15
+ steps :
16
+ - name : Check out package
17
+ uses : actions/checkout@v4
18
+
19
+ - name : Get package version
20
+ run : |
21
+ VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' pyproject.toml)
22
+ echo "pyproject.toml version: $VERSION"
23
+ git config user.name github-actions
24
+ git config user.email [email protected]
25
+ MSG=$(git log $(git describe --tags --abbrev=0)..HEAD --oneline)
26
+ echo "Creating tag $VERSION with message:"
27
+ echo "$MSG"
28
+ git tag -a "$VERSION" -m "$MSG"
29
+
30
+ - name : Publish tags
31
+ run : git push --tags
8
32
9
- jobs :
10
33
build :
11
34
name : Build Package
12
35
runs-on : ubuntu-latest
13
-
36
+ needs :
37
+ - create-tag
14
38
steps :
15
39
- uses : actions/checkout@v4
16
40
with :
32
56
with :
33
57
name : python-package-distributions
34
58
path : dist/
35
-
59
+
36
60
publish-to-pypi :
37
61
name : >-
38
62
Publish Package to PyPI
You can’t perform that action at this time.
0 commit comments