Skip to content

Commit 8e0b067

Browse files
committed
ci: add checksum and signing support for release binaries
Add SHA256 checksum generation and cosign keyless signing to release-trigger.yaml. Checksums and signatures are generated at release time only (not during daily CI builds), keeping the build pipeline fast and release artifacts verifiable. - Generate .sha256 checksum files for all release binaries - Sign binaries with cosign using GitHub OIDC (keyless) - Include .sha256, .sig, and .crt files in GitHub Releases - Remove S3 upload job from ci_main.yml - Delete upload_s3.yml (replaced by GitHub Releases) Resolves: #199 Signed-off-by: vinayakjeet <vinayakjeetog@gmail.com>
1 parent 9359db2 commit 8e0b067

3 files changed

Lines changed: 49 additions & 130 deletions

File tree

.github/workflows/ci_main.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build & Upload
1+
name: Build
22

33
on:
44
push:
@@ -12,9 +12,6 @@ concurrency:
1212
permissions:
1313
contents: read
1414
pull-requests: read
15-
packages: write
16-
id-token: write
17-
attestations: write
1815

1916
jobs:
2017
build:
@@ -24,13 +21,3 @@ jobs:
2421
ref: ${{ github.sha }}
2522
go_version: "1.25.4"
2623

27-
upload:
28-
name: Upload
29-
needs: build
30-
uses: ./.github/workflows/upload_s3.yml
31-
with:
32-
ref: ${{ github.sha }}
33-
secrets:
34-
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
35-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
36-

.github/workflows/release-trigger.yaml

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ jobs:
9999
runs-on: ubuntu-latest
100100
needs: [ci,parse-version-manifest]
101101
if: needs.parse-version-manifest.outputs.version != ''
102+
permissions:
103+
contents: write
104+
id-token: write
102105
steps:
103106
- name: Harden the runner (Audit all outbound calls)
104107
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
@@ -110,41 +113,63 @@ jobs:
110113
with:
111114
fetch-depth: 0
112115

113-
- name: Download urunc amd64 build artifact
116+
- name: Download urunc amd64 build artifact
114117
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
115118
with:
116119
name: urunc_static_amd64-${{ github.run_id }}
117120
path: ${{ env.ARTIFACTS_PATH }}
118121
merge-multiple: true
119-
- name: Download shim amd64 build artifact
122+
- name: Download shim amd64 build artifact
120123
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
121124
with:
122125
name: containerd-shim-urunc-v2_static_amd64-${{ github.run_id }}
123126
path: ${{ env.ARTIFACTS_PATH }}
124127
merge-multiple: true
125128

126-
- name: Download urunc arm64 build artifact
129+
- name: Download urunc arm64 build artifact
127130
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
128131
with:
129132
name: urunc_static_arm64-${{ github.run_id }}
130133
path: ${{ env.ARTIFACTS_PATH }}
131134
merge-multiple: true
132135

133-
- name: Download shim arm64 build artifact
136+
- name: Download shim arm64 build artifact
134137
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
135138
with:
136139
name: containerd-shim-urunc-v2_static_arm64-${{ github.run_id }}
137140
path: ${{ env.ARTIFACTS_PATH }}
138141
merge-multiple: true
139142

143+
- name: Generate checksums
144+
run: |
145+
cd ${{ env.ARTIFACTS_PATH }}
146+
sha256sum urunc_static_amd64 > urunc_static_amd64.sha256
147+
sha256sum urunc_static_arm64 > urunc_static_arm64.sha256
148+
sha256sum containerd-shim-urunc-v2_static_amd64 > containerd-shim-urunc-v2_static_amd64.sha256
149+
sha256sum containerd-shim-urunc-v2_static_arm64 > containerd-shim-urunc-v2_static_arm64.sha256
150+
151+
- name: Install cosign
152+
uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159
153+
154+
- name: Sign binaries with cosign
155+
run: |
156+
cd ${{ env.ARTIFACTS_PATH }}
157+
for bin in urunc_static_amd64 urunc_static_arm64 \
158+
containerd-shim-urunc-v2_static_amd64 \
159+
containerd-shim-urunc-v2_static_arm64; do
160+
cosign sign-blob --yes \
161+
--output-signature "${bin}.sig" \
162+
--output-certificate "${bin}.crt" \
163+
"${bin}"
164+
done
165+
140166
- name: Generate urunc-bot token
141167
id: generate-token
142168
uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
143169
with:
144170
app-id: ${{ vars.URUNC_BOT_APP_ID }}
145171
private-key: ${{ secrets.URUNC_BOT_PRIVATE_KEY }}
146172

147-
148173
- name: Extract release notes for ${{ needs.parse-version-manifest.outputs.version }}
149174
id: extract_notes
150175
run: |
@@ -163,15 +188,27 @@ jobs:
163188
id: create_release
164189
with:
165190
files: |
166-
${{ env.ARTIFACTS_PATH}}/urunc_static_amd64
167-
${{ env.ARTIFACTS_PATH}}/urunc_static_arm64
168-
${{ env.ARTIFACTS_PATH}}/containerd-shim-urunc-v2_static_amd64
169-
${{ env.ARTIFACTS_PATH}}/containerd-shim-urunc-v2_static_arm64
191+
${{ env.ARTIFACTS_PATH }}/urunc_static_amd64
192+
${{ env.ARTIFACTS_PATH }}/urunc_static_amd64.sha256
193+
${{ env.ARTIFACTS_PATH }}/urunc_static_amd64.sig
194+
${{ env.ARTIFACTS_PATH }}/urunc_static_amd64.crt
195+
${{ env.ARTIFACTS_PATH }}/urunc_static_arm64
196+
${{ env.ARTIFACTS_PATH }}/urunc_static_arm64.sha256
197+
${{ env.ARTIFACTS_PATH }}/urunc_static_arm64.sig
198+
${{ env.ARTIFACTS_PATH }}/urunc_static_arm64.crt
199+
${{ env.ARTIFACTS_PATH }}/containerd-shim-urunc-v2_static_amd64
200+
${{ env.ARTIFACTS_PATH }}/containerd-shim-urunc-v2_static_amd64.sha256
201+
${{ env.ARTIFACTS_PATH }}/containerd-shim-urunc-v2_static_amd64.sig
202+
${{ env.ARTIFACTS_PATH }}/containerd-shim-urunc-v2_static_amd64.crt
203+
${{ env.ARTIFACTS_PATH }}/containerd-shim-urunc-v2_static_arm64
204+
${{ env.ARTIFACTS_PATH }}/containerd-shim-urunc-v2_static_arm64.sha256
205+
${{ env.ARTIFACTS_PATH }}/containerd-shim-urunc-v2_static_arm64.sig
206+
${{ env.ARTIFACTS_PATH }}/containerd-shim-urunc-v2_static_arm64.crt
170207
body: ${{ steps.extract_notes.outputs.release_notes }}
171-
name: ${{needs.parse-version-manifest.outputs.version}}
208+
name: ${{ needs.parse-version-manifest.outputs.version }}
172209
draft: false
173210
prerelease: false
174211
generate_release_notes: false
175-
tag_name: ${{needs.parse-version-manifest.outputs.version}}
212+
tag_name: ${{ needs.parse-version-manifest.outputs.version }}
176213
env:
177214
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}

.github/workflows/upload_s3.yml

Lines changed: 0 additions & 105 deletions
This file was deleted.

0 commit comments

Comments
 (0)