@@ -21,6 +21,26 @@ concurrency:
21
21
cancel-in-progress : true
22
22
23
23
jobs :
24
+ find-run :
25
+ name : " Find latest dist run"
26
+ runs-on : " ubuntu-latest"
27
+ outputs :
28
+ run-id : ${{ steps.run-id.outputs.run-id }}
29
+
30
+ steps :
31
+ - name : " Find latest kit.yml run"
32
+ id : runs
33
+
34
+ with :
35
+ route : GET /repos/nedbat/coveragepy/actions/workflows/kit.yml/runs
36
+ env :
37
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
38
+
39
+ - name : " Record run id"
40
+ id : run-id
41
+ run : |
42
+ echo "run-id=${{ fromJson(steps.runs.outputs.data).workflow_runs[0].id }}" >> "$GITHUB_OUTPUT"
43
+
24
44
publish-to-test-pypi :
25
45
name : " Publish to Test PyPI"
26
46
if : ${{ github.event.action == 'publish-testpypi' }}
@@ -29,15 +49,26 @@ jobs:
29
49
runs-on : " ubuntu-latest"
30
50
environment :
31
51
name : " testpypi"
52
+ needs :
53
+ - find-run
32
54
33
55
steps :
34
56
- name : " Download dists"
35
57
uses : actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
36
58
with :
59
+ repository : " nedbat/coveragepy"
60
+ run-id : ${{needs.find-run.outputs.run-id}}
61
+ github-token : ${{ secrets.GITHUB_TOKEN }}
37
62
pattern : " dist-*"
38
63
merge-multiple : true
39
64
path : " dist/"
40
65
66
+ - name : " What did we get?"
67
+ run : |
68
+ ls -alR
69
+ echo "Number of dists:"
70
+ ls -1 dist | wc -l
71
+
41
72
- name : " Publish dists to Test PyPI"
42
73
uses : pypa/gh-action-pypi-publish@4bb033805d9e19112d8c697528791ff53f6c2f74 # v1.9.0
43
74
with :
@@ -53,15 +84,26 @@ jobs:
53
84
runs-on : " ubuntu-latest"
54
85
environment :
55
86
name : " pypi"
87
+ needs :
88
+ - find-run
56
89
57
90
steps :
58
91
- name : " Download dists"
59
92
uses : actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
60
93
with :
94
+ repository : " nedbat/coveragepy"
95
+ run-id : ${{needs.find-run.outputs.run-id}}
96
+ github-token : ${{ secrets.GITHUB_TOKEN }}
61
97
pattern : " dist-*"
62
98
merge-multiple : true
63
99
path : " dist/"
64
100
101
+ - name : " What did we get?"
102
+ run : |
103
+ ls -alR
104
+ echo "Number of dists:"
105
+ ls -1 dist | wc -l
106
+
65
107
- name : " Publish dists to PyPI"
66
108
uses : pypa/gh-action-pypi-publish@4bb033805d9e19112d8c697528791ff53f6c2f74 # v1.9.0
67
109
with :
0 commit comments