Skip to content

Commit 125477f

Browse files
mattmoorgcalmettes-fbox
authored andcommitted
Start keyless signing kaniko releases (GoogleContainerTools#1841)
1 parent 524de6c commit 125477f

1 file changed

Lines changed: 44 additions & 9 deletions

File tree

.github/workflows/release.yaml

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77

88
jobs:
99
build-executor:
10+
permissions:
11+
# Read the repo contents
12+
contents: read
13+
# Produce identity token for keyless signing
14+
id-token: write
15+
1016
env:
1117
GITHUB_SHA: ${{ github.sha }}
1218
GITHUB_REF: ${{ github.ref }}
@@ -71,11 +77,20 @@ jobs:
7177
cosign-release: 'v1.4.1'
7278

7379
# Use cosign to sign the images
74-
- run: |
80+
- env:
81+
COSIGN_EXPERIMENTAL: "true"
82+
run: |
7583
export KMS_VAL=gcpkms://projects/kaniko-project/locations/global/keyRings/cosign/cryptoKeys/cosign
7684
cosign sign -kms $KMS_VAL gcr.io/kaniko-project/executor@${{ steps.build-and-push.outputs.digest }}
85+
cosign sign gcr.io/kaniko-project/executor@${{ steps.build-and-push.outputs.digest }}
7786
7887
build-debug:
88+
permissions:
89+
# Read the repo contents
90+
contents: read
91+
# Produce identity token for keyless signing
92+
id-token: write
93+
7994
env:
8095
GITHUB_SHA: ${{ github.sha }}
8196
GITHUB_REF: ${{ github.ref }}
@@ -116,7 +131,7 @@ jobs:
116131
project_id: kaniko-project
117132
export_default_credentials: true
118133

119-
# Configure docker to use the gcloud command-line tool as a credential helper
134+
# Configure docker to use the gcloud command-line tool as a credential helper
120135
- run: |
121136
# Set up docker to authenticate
122137
# via gcloud command-line tool.
@@ -126,7 +141,7 @@ jobs:
126141
id: build-and-push
127142
with:
128143
context: .
129-
file: ./deploy/Dockerfile_debug
144+
file: ./deploy/Dockerfile_debug
130145
platforms: ${{ env.PLATFORMS }}
131146
push: true
132147
tags: |
@@ -139,12 +154,21 @@ jobs:
139154
with:
140155
cosign-release: 'v1.4.1'
141156

142-
# Use cosign to sign the images
143-
- run: |
157+
# Use cosign to sign the images
158+
- env:
159+
COSIGN_EXPERIMENTAL: "true"
160+
run: |
144161
export KMS_VAL=gcpkms://projects/kaniko-project/locations/global/keyRings/cosign/cryptoKeys/cosign
145162
cosign sign -kms $KMS_VAL gcr.io/kaniko-project/executor@${{ steps.build-and-push.outputs.digest }}
163+
cosign sign gcr.io/kaniko-project/executor@${{ steps.build-and-push.outputs.digest }}
146164
147165
build-warmer:
166+
permissions:
167+
# Read the repo contents
168+
contents: read
169+
# Produce identity token for keyless signing
170+
id-token: write
171+
148172
env:
149173
GITHUB_SHA: ${{ github.sha }}
150174
GITHUB_REF: ${{ github.ref }}
@@ -208,12 +232,21 @@ jobs:
208232
with:
209233
cosign-release: 'v1.4.1'
210234

211-
# Use cosign to sign the images
212-
- run: |
235+
# Use cosign to sign the images
236+
- env:
237+
COSIGN_EXPERIMENTAL: "true"
238+
run: |
213239
export KMS_VAL=gcpkms://projects/kaniko-project/locations/global/keyRings/cosign/cryptoKeys/cosign
214240
cosign sign -kms $KMS_VAL gcr.io/kaniko-project/warmer@${{ steps.build-and-push.outputs.digest }}
241+
cosign sign gcr.io/kaniko-project/warmer@${{ steps.build-and-push.outputs.digest }}
215242
216243
build-slim:
244+
permissions:
245+
# Read the repo contents
246+
contents: read
247+
# Produce identity token for keyless signing
248+
id-token: write
249+
217250
env:
218251
GITHUB_SHA: ${{ github.sha }}
219252
GITHUB_REF: ${{ github.ref }}
@@ -278,7 +311,9 @@ jobs:
278311
cosign-release: 'v1.4.1'
279312

280313
# Use cosign to sign the images
281-
- run: |
314+
- env:
315+
COSIGN_EXPERIMENTAL: "true"
316+
run: |
282317
export KMS_VAL=gcpkms://projects/kaniko-project/locations/global/keyRings/cosign/cryptoKeys/cosign
283318
cosign sign -kms $KMS_VAL gcr.io/kaniko-project/executor@${{ steps.build-and-push.outputs.digest }}
284-
319+
cosign sign gcr.io/kaniko-project/executor@${{ steps.build-and-push.outputs.digest }}

0 commit comments

Comments
 (0)