Skip to content

Commit 767b7f8

Browse files
authored
build: artifact attestation (#2205)
1 parent 4acffd1 commit 767b7f8

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

.github/workflows/build_release.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
permissions:
2222
contents: read
2323
packages: write
24+
id-token: write
25+
attestations: write
2426

2527
build_web:
2628
concurrency:
@@ -29,7 +31,8 @@ jobs:
2931
environment: production
3032
permissions:
3133
contents: read
32-
id-token: write # aws
34+
id-token: write # aws + attestation
35+
attestations: write
3336
steps:
3437
- uses: actions/checkout@v5
3538

@@ -68,6 +71,11 @@ jobs:
6871
run: |
6972
zip -r Voyager-Web-$BUILD_LABEL.zip dist
7073
74+
- name: Generate artifact attestation
75+
uses: actions/attest-build-provenance@v3
76+
with:
77+
subject-path: Voyager-Web-${{ env.BUILD_LABEL }}.zip
78+
7179
- name: Upload artifacts
7280
uses: actions/upload-artifact@v4
7381
with:
@@ -79,6 +87,10 @@ jobs:
7987
group: ios-release
8088
environment: deploy
8189
runs-on: macos-latest
90+
permissions:
91+
contents: read
92+
id-token: write
93+
attestations: write
8294
steps:
8395
- uses: actions/checkout@v5
8496

@@ -123,6 +135,11 @@ jobs:
123135
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }}
124136
COMMIT_MSG: ${{ github.event.commits[0].message }}
125137

138+
- name: Generate artifact attestation
139+
uses: actions/attest-build-provenance@v3
140+
with:
141+
subject-path: Voyager-iOS-${{ env.BUILD_LABEL }}.ipa
142+
126143
- name: Upload iOS IPA as artifact
127144
uses: actions/upload-artifact@v4
128145
with:
@@ -131,6 +148,10 @@ jobs:
131148

132149
build_android:
133150
runs-on: ubuntu-latest
151+
permissions:
152+
contents: read
153+
id-token: write
154+
attestations: write
134155
steps:
135156
- uses: actions/checkout@v5
136157

@@ -175,6 +196,11 @@ jobs:
175196

176197
- run: mv android/app/build/outputs/apk/release/app-release.apk Voyager-Android-${{ env.BUILD_LABEL }}.apk
177198

199+
- name: Generate artifact attestation
200+
uses: actions/attest-build-provenance@v3
201+
with:
202+
subject-path: Voyager-Android-${{ env.BUILD_LABEL }}.apk
203+
178204
- name: Send to Artifacts
179205
uses: actions/upload-artifact@v4
180206
with:

.github/workflows/docker.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
permissions:
1919
contents: read
2020
packages: write
21+
id-token: write
22+
attestations: write
2123

2224
steps:
2325
- name: Checkout
@@ -57,6 +59,7 @@ jobs:
5759
password: ${{ github.token }}
5860

5961
- name: Build and push
62+
id: push
6063
uses: docker/build-push-action@v6
6164
with:
6265
context: .
@@ -66,3 +69,11 @@ jobs:
6669
labels: ${{ steps.metal.outputs.labels }}
6770
cache-from: type=gha
6871
cache-to: type=gha,mode=max
72+
73+
- name: Generate artifact attestation
74+
if: github.event_name != 'pull_request'
75+
uses: actions/attest-build-provenance@v3
76+
with:
77+
subject-name: ghcr.io/${{ github.repository }}
78+
subject-digest: ${{ steps.push.outputs.digest }}
79+
push-to-registry: true

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ jobs:
123123
permissions:
124124
contents: write # needed for create_release, even though it won't be called
125125
packages: write # docker release
126-
id-token: write # aws
126+
id-token: write # aws + attestation
127+
attestations: write
127128

128129
push_release:
129130
needs: [bump_src, app_build, app_version]

0 commit comments

Comments
 (0)