-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from puerco/release-workflow
Add release workflow with SBOM generation
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
license: Apache-2.0 | ||
name: sigs.k8s.io/release-utils | ||
creator: | ||
person: The Kubernetes Authors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write # needed to write releases | ||
|
||
steps: | ||
- name: Set tag name | ||
shell: bash | ||
run: | | ||
echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
- name: Check out code | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
with: | ||
fetch-depth: 1 | ||
- name: Set up go | ||
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v3 | ||
with: | ||
go-version-file: go.mod | ||
check-latest: true | ||
cache: false | ||
- name: Install bom | ||
uses: kubernetes-sigs/release-actions/setup-bom@2f8b9ec22aedc9ce15039b6c7716aa6c2907df1c # v0.2.0 | ||
- name: Generate SBOM | ||
shell: bash | ||
run: | | ||
bom generate -c .bom.yaml --format=json -o /tmp/sigs.k8s.io-release-utils-$TAG.spdx.json . | ||
- name: Publish Release | ||
uses: kubernetes-sigs/release-actions/publish-release@2f8b9ec22aedc9ce15039b6c7716aa6c2907df1c # v0.2.0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
assets: "/tmp/sigs.k8s.io-release-utils-$TAG.spdx.json" | ||
sbom: false |