11
11
default : " main"
12
12
type : string
13
13
test_pypi_publish :
14
- description : " Publish to Test PyPi (true | false) "
14
+ description : " Publish to Test PyPi"
15
15
default : false
16
16
type : boolean
17
17
pypi_publish :
18
- description : " Publish to PyPi (true | false) "
18
+ description : " Publish to PyPi"
19
19
default : false
20
20
type : boolean
21
21
26
26
default : " main"
27
27
type : string
28
28
test_pypi_publish :
29
- description : " Publish to Test PyPi (true | false) "
29
+ description : " Publish to Test PyPi"
30
30
default : false
31
31
type : boolean
32
32
pypi_publish :
33
- description : " Publish to PyPi (true | false)) "
33
+ description : " Publish to PyPi"
34
34
default : false
35
35
type : boolean
36
36
@@ -54,28 +54,44 @@ jobs:
54
54
with :
55
55
path : dist/*
56
56
57
- upload_pypi :
58
- name : Upload to PyPI (optional)
57
+ upload_test_pypi :
58
+ name : Upload to test PyPI (optional)
59
+ if : ${{ github.event.inputs.test_pypi_publish == 'true' }}
59
60
needs : [build]
60
61
runs-on : ubuntu-latest
62
+ environment :
63
+ name : testpypi
64
+ url : https://test.pypi.org/p/fenics-ufl
65
+ permissions :
66
+ id-token : write
67
+
61
68
steps :
62
69
- uses : actions/download-artifact@v4
63
70
with :
64
71
name : artifact
65
72
path : dist
66
73
67
- - name : Push to PyPI
74
+ - name : Push to test PyPI
68
75
uses : pypa/gh-action-pypi-publish@release/v1
69
- if : ${{ github.event.inputs.pypi_publish == 'true' }}
70
76
with :
71
- user : __token__
72
- password : ${{ secrets.PYPI_TOKEN }}
73
- repository-url : https://upload.pypi.org/legacy/
77
+ repository-url : https://test.pypi.org/legacy/
78
+
79
+ upload_pypi :
80
+ name : Upload to PyPI (optional)
81
+ if : ${{ github.event.inputs.pypi_publish == 'true' }}
82
+ needs : [build]
83
+ runs-on : ubuntu-latest
84
+ environment :
85
+ name : pypi
86
+ url : https://pypi.org/p/fenics-ufl
87
+ permissions :
88
+ id-token : write
89
+
90
+ steps :
91
+ - uses : actions/download-artifact@v4
92
+ with :
93
+ name : artifact
94
+ path : dist
74
95
75
- - name : Push to Test PyPI
96
+ - name : Push to PyPI
76
97
uses : pypa/gh-action-pypi-publish@release/v1
77
- if : ${{ github.event.inputs.test_pypi_publish == 'true' }}
78
- with :
79
- user : __token__
80
- password : ${{ secrets.PYPI_TEST_TOKEN }}
81
- repository-url : https://test.pypi.org/legacy/
0 commit comments