1
- name : Publish to PyPI
1
+ name : Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
2
2
3
- on :
4
- release :
5
- types : [published]
3
+ on : push
6
4
7
5
jobs :
8
6
build :
12
10
steps :
13
11
- uses : actions/checkout@v4
14
12
- name : Set up Python
15
- uses : actions/setup-python@v4
13
+ uses : actions/setup-python@v5
16
14
with :
17
15
python-version : " 3.x"
18
16
- name : Install poetry
@@ -24,27 +22,26 @@ jobs:
24
22
- name : Build package
25
23
run : poetry build
26
24
- name : Store the distribution packages
27
- uses : actions/upload-artifact@v3
25
+ uses : actions/upload-artifact@v4
28
26
with :
29
27
name : python-package-distributions
30
28
path : dist/
31
29
32
30
publish-to-pypi :
33
- name : >-
34
- Publish Python 🐍 distribution 📦 to PyPI
35
- if : startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
31
+ name : Publish Python 🐍 distribution 📦 to PyPI
32
+ if : startsWith(github.ref, 'refs/tags/')
36
33
needs :
37
34
- build
38
35
runs-on : ubuntu-latest
39
36
environment :
40
37
name : pypi
41
- url : https://pypi.org/p/structure-align
38
+ url : https://pypi.org/p/structurealign
42
39
permissions :
43
40
id-token : write
44
41
45
42
steps :
46
43
- name : Download all the dists
47
- uses : actions/download-artifact@v3
44
+ uses : actions/download-artifact@v4
48
45
with :
49
46
name : python-package-distributions
50
47
path : dist/
81
78
run : >-
82
79
gh release upload
83
80
'${{ github.ref_name }}' dist/**
84
- --repo '${{ github.repository }}'
81
+ --repo '${{ github.repository }}'
82
+
83
+ publish-to-testpypi :
84
+ name : Publish Python 🐍 distribution 📦 to TestPyPI
85
+ needs :
86
+ - build
87
+ runs-on : ubuntu-latest
88
+ environment :
89
+ name : testpypi
90
+ url : https://test.pypi.org/p/structurealign
91
+
92
+ permissions :
93
+ id-token : write
94
+
95
+ steps :
96
+ - name : Download all the dists
97
+ uses : actions/download-artifact@v4
98
+ with :
99
+ name : python-package-distributions
100
+ path : dist/
101
+ - name : Publish distribution 📦 to TestPyPI
102
+ uses : pypa/gh-action-pypi-publish@release/v1
103
+ with :
104
+ repository-url : https://test.pypi.org/legacy/
0 commit comments