|
6 | 6 | - "v*.*.*" |
7 | 7 |
|
8 | 8 | permissions: |
9 | | - contents: write |
| 9 | + contents: read |
10 | 10 |
|
11 | 11 | jobs: |
12 | | - release: |
13 | | - name: Build immutable release |
| 12 | + build: |
| 13 | + name: Build and validate release |
14 | 14 | runs-on: ubuntu-latest |
15 | 15 | timeout-minutes: 15 |
| 16 | + permissions: |
| 17 | + contents: read |
16 | 18 | steps: |
17 | 19 | - name: Check out tagged commit |
18 | 20 | uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 21 | + with: |
| 22 | + persist-credentials: false |
19 | 23 |
|
20 | 24 | - name: Set up Python |
21 | 25 | uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 |
@@ -52,10 +56,40 @@ jobs: |
52 | 56 | uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
53 | 57 | with: |
54 | 58 | name: "Italian_Cities-${{ github.ref_name }}" |
55 | | - path: "dist/${{ github.ref_name }}/*" |
| 59 | + path: "dist/${{ github.ref_name }}/" |
56 | 60 | if-no-files-found: error |
57 | 61 | retention-days: 30 |
58 | 62 |
|
| 63 | + publish: |
| 64 | + name: Attest and publish release |
| 65 | + needs: build |
| 66 | + runs-on: ubuntu-latest |
| 67 | + timeout-minutes: 10 |
| 68 | + permissions: |
| 69 | + attestations: write |
| 70 | + contents: write |
| 71 | + id-token: write |
| 72 | + steps: |
| 73 | + - name: Check out release metadata |
| 74 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 75 | + with: |
| 76 | + persist-credentials: false |
| 77 | + |
| 78 | + - name: Download validated release package |
| 79 | + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 |
| 80 | + with: |
| 81 | + name: "Italian_Cities-${{ github.ref_name }}" |
| 82 | + path: "dist/${{ github.ref_name }}" |
| 83 | + |
| 84 | + - name: Verify release checksums |
| 85 | + working-directory: "dist/${{ github.ref_name }}" |
| 86 | + run: shasum -a 256 -c SHA256SUMS |
| 87 | + |
| 88 | + - name: Attest release assets |
| 89 | + uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1 |
| 90 | + with: |
| 91 | + subject-path: "dist/${{ github.ref_name }}/*" |
| 92 | + |
59 | 93 | - name: Refuse to overwrite an existing release |
60 | 94 | env: |
61 | 95 | GH_TOKEN: ${{ github.token }} |
|
0 commit comments