1- name : Publish to TestPyPI
1+ name : Publish Pre-Release to TestPyPI
22
33on : workflow_dispatch
44
55jobs :
6- publish :
7- name : Build
6+ build :
7+ name : Build distribution
88 runs-on : ubuntu-latest
9-
10- # This environment is required as an input to pypa/gh-action-pypi-publish
11- environment :
12- name : testpypi
13- url : https://test.pypi.org/p/seclab-taskflows
14-
15- env :
16- GITHUB_REPO : ${{ github.repository }}
9+ outputs :
10+ release_name : ${{ steps.create_version_number.outputs.RELEASE_NAME }}
1711
1812 permissions :
19- contents : write
20- id-token : write # For trusted publishing
21- attestations : write # For artifact attestation
13+ contents : read
2214
2315 steps :
2416 - name : Checkout repository
25- uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 .0.0
17+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 .0.2
2618 with :
2719 persist-credentials : false
2820
2921 - name : Set up Python
30- uses : actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0 .0
22+ uses : actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2 .0
3123 with :
3224 python-version : " 3.14"
3325
@@ -52,25 +44,50 @@ jobs:
5244 - name : Build the wheel
5345 run : python3 -m hatch build
5446
55- - name : Attest build provenance
56- uses : actions/attest-build-provenance@96278af6caaf10aea03fd8d33a09a777ca52d62f # v3.2.0
47+ - name : Upload artifacts
48+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
5749 with :
58- subject-path : ./dist/*
50+ name : python-package-distributions
51+ path : ./dist/
5952
60- - name : Upload artifacts
61- uses : actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
53+ publish :
54+ name : Publish to TestPyPI
55+ needs : build
56+ runs-on : ubuntu-latest
57+
58+ # This environment is required as an input to pypa/gh-action-pypi-publish
59+ environment :
60+ name : testpypi
61+ url : https://test.pypi.org/p/seclab-taskflows
62+
63+ env :
64+ GITHUB_REPO : ${{ github.repository }}
65+
66+ permissions :
67+ contents : write
68+ id-token : write # For trusted publishing
69+ attestations : write # For artifact attestation
70+
71+ steps :
72+ - name : Download distribution artifacts
73+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
6274 with :
6375 name : python-package-distributions
64- path : dist/
76+ path : ./dist/
77+
78+ - name : Attest build provenance
79+ uses : actions/attest@v4.1.0 # immutable release
80+ with :
81+ subject-path : ./dist/*
6582
6683 - name : Publish to TestPyPI
67- uses : pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13 .0
84+ uses : pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14 .0
6885 with :
6986 repository-url : https://test.pypi.org/legacy/
7087 verbose : true
7188
7289 - name : Create GitHub Release
7390 env :
7491 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
75- RELEASE_NAME : ${{ steps.create_version_number .outputs.RELEASE_NAME }}
92+ RELEASE_NAME : ${{ needs.build .outputs.release_name }}
7693 run : gh release create $RELEASE_NAME dist/* --repo $GITHUB_REPO --prerelease --generate-notes
0 commit comments