Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): add signing for each binary #203

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading