File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : " Release"
2+
3+ on :
4+ push :
5+ tags :
6+ - " *"
7+
8+ jobs :
9+ build :
10+ name : " Build dists"
11+ runs-on : " ubuntu-latest"
12+ environment :
13+ name : " publish"
14+ outputs :
15+ hashes : ${{ steps.hash.outputs.hashes }}
16+ steps :
17+ - name : " Checkout repository"
18+ uses : " actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b" # tag=v3
19+
20+ - name : " Setup Python"
21+ uses : " actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984" # tag=v4
22+ with :
23+ python-version : " 3.x"
24+
25+ - name : " Install dependencies"
26+ run : python -m pip install build
27+
28+ - name : Build using Python
29+ id : build
30+ run : |
31+ python -m build
32+
33+ - name : Generate subject
34+ id : hash
35+ run : |
36+ cd dist
37+ HASHES=$(sha256sum * | base64 -w0)
38+ echo "hashes=$HASHES" >> "$GITHUB_OUTPUT"
39+
40+ provenance :
41+ needs : [build]
42+ permissions :
43+ actions : read # To read the workflow path.
44+ id-token : write # To sign the provenance.
45+ contents : write # To add assets to a release.
46+ uses : slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.9.0
47+ with :
48+ base64-subjects : " ${{ needs.build.outputs.hashes }}"
49+ upload-assets : true # Optional: Upload to a new release
50+ steps :
51+ - name : " Download dists"
52+ uses : " actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741"
53+ with :
54+ name : " dist"
55+ path : " dist/"
56+
57+ - name : " Upload dists to GitHub Release"
58+ env :
59+ GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
60+ # run: |
61+ # gh release upload ${{ github.ref_name }} dist/* --repo ${{ github.repository }}
You can’t perform that action at this time.
0 commit comments