12
12
- published
13
13
14
14
jobs :
15
- build :
16
- name : Build
15
+ build-peakrdl-cli :
16
+ name : Build peakrdl-cli
17
17
runs-on : ubuntu-latest
18
18
steps :
19
19
- uses : actions/checkout@v3
@@ -30,18 +30,44 @@ jobs:
30
30
- name : Build
31
31
run : |
32
32
python -m build peakrdl-cli -o dist/
33
+
34
+ - uses : actions/upload-artifact@v4
35
+ with :
36
+ name : dist-peakrdl-cli
37
+ path : |
38
+ dist/*.tar.gz
39
+ dist/*.whl
40
+
41
+ build-peakrdl :
42
+ name : Build peakrdl
43
+ runs-on : ubuntu-latest
44
+ steps :
45
+ - uses : actions/checkout@v3
46
+
47
+ - uses : actions/setup-python@v4
48
+ name : Install Python
49
+ with :
50
+ python-version : " 3.11"
51
+
52
+ - name : Install dependencies
53
+ run : |
54
+ python -m pip install build
55
+
56
+ - name : Build
57
+ run : |
33
58
python -m build peakrdl -o dist/
34
59
35
60
- uses : actions/upload-artifact@v4
36
61
with :
37
- name : dist
62
+ name : dist-peakrdl
38
63
path : |
39
64
dist/*.tar.gz
40
65
dist/*.whl
41
66
# -------------------------------------------------------------------------------
42
67
test :
43
68
needs :
44
- - build
69
+ - build-peakrdl-cli
70
+ - build-peakrdl
45
71
strategy :
46
72
matrix :
47
73
python-version :
@@ -77,7 +103,12 @@ jobs:
77
103
78
104
- uses : actions/download-artifact@v4
79
105
with :
80
- name : dist
106
+ name : dist-peakrdl
107
+ path : dist
108
+
109
+ - uses : actions/download-artifact@v4
110
+ with :
111
+ name : dist-peakrdl-cli
81
112
path : dist
82
113
83
114
- name : Install dependencies
@@ -122,7 +153,7 @@ jobs:
122
153
# -------------------------------------------------------------------------------
123
154
lint :
124
155
needs :
125
- - build
156
+ - build-peakrdl-cli
126
157
runs-on : ubuntu-latest
127
158
steps :
128
159
- uses : actions/checkout@v3
@@ -133,7 +164,7 @@ jobs:
133
164
134
165
- uses : actions/download-artifact@v4
135
166
with :
136
- name : dist
167
+ name : dist-peakrdl-cli
137
168
path : dist
138
169
139
170
- name : Install dependencies
@@ -151,7 +182,7 @@ jobs:
151
182
# -------------------------------------------------------------------------------
152
183
mypy :
153
184
needs :
154
- - build
185
+ - build-peakrdl-cli
155
186
runs-on : ubuntu-latest
156
187
steps :
157
188
- uses : actions/checkout@v3
@@ -162,7 +193,7 @@ jobs:
162
193
163
194
- uses : actions/download-artifact@v4
164
195
with :
165
- name : dist
196
+ name : dist-peakrdl-cli
166
197
path : dist
167
198
168
199
- name : Install dependencies
@@ -178,11 +209,35 @@ jobs:
178
209
mypy --config-file test/mypy.ini peakrdl-cli/src/peakrdl
179
210
180
211
# -------------------------------------------------------------------------------
181
- deploy :
212
+ deploy-peakrdl :
213
+ needs :
214
+ - test
215
+ - lint
216
+ - mypy
217
+ - build-peakrdl
218
+
219
+ runs-on : ubuntu-latest
220
+ environment : release
221
+ permissions :
222
+ id-token : write
223
+
224
+ # Only publish when a GitHub Release is created.
225
+ if : github.event_name == 'release'
226
+ steps :
227
+ - uses : actions/download-artifact@v4
228
+ with :
229
+ name : dist-peakrdl
230
+ path : dist
231
+
232
+ - uses : pypa/gh-action-pypi-publish@release/v1
233
+
234
+
235
+ deploy-peakrdl-cli :
182
236
needs :
183
237
- test
184
238
- lint
185
239
- mypy
240
+ - build-peakrdl-cli
186
241
187
242
runs-on : ubuntu-latest
188
243
environment : release
@@ -194,7 +249,7 @@ jobs:
194
249
steps :
195
250
- uses : actions/download-artifact@v4
196
251
with :
197
- name : dist
252
+ name : dist-peakrdl-cli
198
253
path : dist
199
254
200
255
- uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments