Skip to content

Commit 1d1ad2d

Browse files
committed
Fix Release Artifact Signing
1 parent 2508680 commit 1d1ad2d

File tree

3 files changed

+56
-69
lines changed

3 files changed

+56
-69
lines changed

.github/workflows/part_release.yml

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ permissions:
1515
contents: read
1616

1717
jobs:
18-
create_prerelease:
19-
name: Create Prerelease
20-
21-
if: ${{ !inputs.stable }}
18+
create:
19+
name: Create Release
2220

2321
runs-on: ubuntu-latest
2422

@@ -32,6 +30,7 @@ jobs:
3230
egress-policy: audit
3331

3432
- name: Create prerelease
33+
if: ${{ !inputs.stable }}
3534
env:
3635
GITHUB_TOKEN: ${{ github.token }}
3736
run: |
@@ -42,28 +41,54 @@ jobs:
4241
--generate-notes \
4342
${{ inputs.releaseName }}
4443
45-
create_stable:
46-
name: Create Stable
44+
- name: Create release
45+
if: ${{ inputs.stable }}
46+
env:
47+
GITHUB_TOKEN: ${{ github.token }}
48+
run: |
49+
gh release create \
50+
--repo ${{ github.repository }} \
51+
--title ${{ inputs.releaseName }} \
52+
--generate-notes \
53+
${{ inputs.releaseName }}
54+
55+
upload_release:
56+
name: "Upload"
4757

48-
if: ${{ inputs.stable }}
58+
needs: ["create"]
4959

5060
runs-on: ubuntu-latest
5161

5262
permissions:
63+
id-token: write
5364
contents: write
65+
attestations: write
5466

5567
steps:
5668
- name: Harden Runner
5769
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
5870
with:
5971
egress-policy: audit
6072

61-
- name: Create release
73+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
74+
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
75+
with:
76+
name: docs
77+
path: docs
78+
- run: |
79+
tar -czvf docs.tar.gz docs
80+
- name: "Attest Documentation"
81+
id: attestation
82+
uses: actions/attest-build-provenance@1c608d11d69870c2092266b3f9a6f3abbf17002c # v1.4.3
83+
with:
84+
subject-path: "docs.tar.gz"
85+
- name: Copy Attestation
86+
run: cp "$ATTESTATION" docs.tar.gz.sigstore
87+
env:
88+
ATTESTATION: "${{ steps.attestation.outputs.bundle-path }}"
89+
- name: Upload
6290
env:
6391
GITHUB_TOKEN: ${{ github.token }}
6492
run: |
65-
gh release create \
66-
--repo ${{ github.repository }} \
67-
--title ${{ inputs.releaseName }} \
68-
--generate-notes \
69-
${{ inputs.releaseName }}
93+
gh release upload --clobber "${{ github.ref_name }}" \
94+
docs.tar.gz docs.tar.gz.sigstore

.github/workflows/tag-beta.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ permissions:
99
contents: read
1010

1111
jobs:
12+
docs:
13+
name: "Docs"
14+
15+
uses: ./.github/workflows/part_docs.yml
16+
1217
release:
1318
name: "Release"
1419

20+
needs: ["docs"]
21+
1522
permissions:
23+
id-token: write
1624
contents: write
25+
attestations: write
1726

1827
uses: ./.github/workflows/part_release.yml
1928
with:
2029
releaseName: "${{ github.ref_name }}"
21-
22-
docs:
23-
name: "Docs"
24-
25-
needs: ["release"]
26-
27-
uses: ./.github/workflows/part_docs.yml
28-
with:
29-
releaseName: "${{ github.ref_name }}"

.github/workflows/tag-stable.yml

Lines changed: 9 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,33 @@ permissions:
99
contents: read
1010

1111
jobs:
12+
docs:
13+
name: "Docs"
14+
15+
uses: ./.github/workflows/part_docs.yml
16+
1217
release:
1318
name: "Release"
1419

20+
needs: ["docs"]
21+
1522
permissions:
23+
id-token: write
1624
contents: write
25+
attestations: write
1726

1827
uses: ./.github/workflows/part_release.yml
1928
with:
2029
releaseName: "${{ github.ref_name }}"
2130
stable: true
2231

23-
docs:
24-
name: "Docs"
25-
26-
needs: ["release"]
27-
28-
uses: ./.github/workflows/part_docs.yml
29-
with:
30-
releaseName: "${{ github.ref_name }}"
31-
3232
deploy_pages:
3333
name: "Deploy to GitHub Pages"
3434

3535
needs: ["release", "docs"]
3636

3737
runs-on: ubuntu-latest
3838

39-
if: ${{ inputs.publishToPages }}
40-
4139
permissions:
4240
pages: write
4341
id-token: write
@@ -55,39 +53,3 @@ jobs:
5553
- name: Deploy to GitHub Pages
5654
id: deployment
5755
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
58-
59-
upload_release:
60-
name: "Upload"
61-
62-
needs: ["release", "docs"]
63-
64-
runs-on: ubuntu-latest
65-
66-
if: ${{ inputs.releaseName }}
67-
68-
permissions:
69-
contents: write
70-
attestations: write
71-
72-
steps:
73-
- name: Harden Runner
74-
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
75-
with:
76-
egress-policy: audit
77-
78-
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
79-
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
80-
with:
81-
name: docs
82-
path: docs
83-
- run: |
84-
tar -czvf docs.tar.gz docs
85-
- name: Upload
86-
env:
87-
GITHUB_TOKEN: ${{ github.token }}
88-
run: |
89-
gh release upload --clobber "${{ inputs.releaseName }}" \
90-
docs.tar.gz
91-
- name: "Attest Documentation"
92-
uses: actions/attest@67422f5511b7ff725f4dbd6fb9bd2cd925c65a8d # v1.4.1
93-
subject-path: "docs.tar.gz"

0 commit comments

Comments
 (0)