From c7248a05a11b1650288b07b49836e4ae4fefc765 Mon Sep 17 00:00:00 2001 From: Gergely Brautigam <182850+Skarlso@users.noreply.github.com> Date: Tue, 7 May 2024 14:47:51 +0200 Subject: [PATCH] feature: add sbom and signing to the produced binaries (#93) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description related to https://github.com/open-component-model/ocm-project/issues/82 ## What type of PR is this? (check all applicable) - [ ] 🍕 Feature - [ ] 🐛 Bug Fix - [ ] 📝 Documentation Update - [ ] 🎨 Style - [ ] 🧑‍💻 Code Refactor - [ ] 🔥 Performance Improvements - [ ] ✅ Test - [ ] 🤖 Build - [ ] 🔁 CI - [ ] 📦 Chore (Release) - [ ] ⏩ Revert ## Related Tickets & Documents - Related Issue # (issue) - Closes # (issue) - Fixes # (issue) > Remove if not applicable ## Screenshots ## Added tests? - [ ] 👍 yes - [ ] 🙅 no, because they aren't needed - [ ] 🙋 no, because I need help - [ ] Separate ticket for tests # (issue/pr) Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration ## Added to documentation? - [ ] 📜 README.md - [ ] 🙅 no documentation needed ## Checklist: - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules --- .github/workflows/release.yaml | 4 ++++ .goreleaser.yaml | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2425e24..3b35ee4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -95,6 +95,10 @@ jobs: run: | mkdir -p output kustomize build ./config/default > ./output/install.yaml + - name: Setup Syft + uses: anchore/sbom-action/download-syft@7ccf588e3cf3cc2611714c2eeae48550fbc17552 # v0.15.11 + - name: Setup Cosign + uses: sigstore/cosign-installer@v3.5.0 - name: Run goreleaser uses: goreleaser/goreleaser-action@v5 with: diff --git a/.goreleaser.yaml b/.goreleaser.yaml index f174d31..cfbe229 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -28,6 +28,24 @@ checksum: - glob: output/install.yaml snapshot: name_template: "{{ incpatch .Version }}-next" +sboms: + - id: source + artifacts: source + documents: + - "{{ .ProjectName }}-{{ .Version }}-sbom.spdx.json" +signs: + - cmd: cosign + env: + - COSIGN_EXPERIMENTAL=1 + certificate: '${artifact}.pem' + args: + - sign-blob + - '--output-certificate=${certificate}' + - '--output-signature=${signature}' + - '${artifact}' + - '--yes' + artifacts: checksum + output: true changelog: sort: asc filters: