Skip to content

Commit

Permalink
add signing for each binary
Browse files Browse the repository at this point in the history
Signed-off-by: jiaxiao zhou <[email protected]>
  • Loading branch information
Mossaka committed Jan 24, 2024
1 parent 75a43c9 commit 962c456
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ env:
CARGO_TERM_COLOR: always
jobs:
build:
permissions:
# cosign uses the GitHub OIDC token
id-token: write
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
Expand Down Expand Up @@ -46,21 +49,33 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler libseccomp-dev
- name: Setup cosign for signing
uses: sigstore/[email protected]
with:
cosign-release: 'v2.2.2'
- name: build ${{ matrix.shims.name }}
run: |
VERBOSE=1 make build SHIMS=${{ matrix.shims.name }}
- name: unit tests ${{ matrix.shims.name }}
run: |
VERBOSE=1 make unit-tests SHIMS=${{ matrix.shims.name }}
- name: Sign the binary
run: |
mkdir _dist
cp containerd-shim-*/target/${{ matrix.config.arch }}-unknown-linux-musl/release/containerd-shim-*-${{ matrix.shims.version }} _dist/
cd _dist
cosign sign-blob --yes \
--output-certificate containerd-shim-${{ needs.parse.outputs.runtime }}-${{ matrix.shims.version }}-crt.pem \
--output-signature containerd-shim-${{ needs.parse.outputs.runtime }}-${{ matrix.shims.version }}.sig \
containerd-shim-${{ needs.parse.outputs.runtime }}-${{ matrix.shims.version }}
- name: lowercase the runner OS name
shell: bash
run: |
OS=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')
echo "RUNNER_OS=$OS" >> $GITHUB_ENV
- name: package release assets
run: |
mkdir _dist
cp containerd-shim-*/target/${{ matrix.config.arch }}-unknown-linux-musl/release/containerd-shim-*-${{ matrix.shims.version }} _dist/
cd _dist
tar czf containerd-wasm-shims-${{ matrix.shims.version }}-${{ matrix.shims.name }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz containerd-shim-*-${{ matrix.shims.version }}
- name: upload shim artifacts
Expand Down

0 comments on commit 962c456

Please sign in to comment.