Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 60d1304

Browse files
committedJun 10, 2024··
Add initial release automation
This commmit adds the first basic release workflow to cut a release and build an SBOM. Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
1 parent e51eadb commit 60d1304

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
 

‎.github/workflows/release.yaml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# ------------------------------------------------------------------------
2+
# SPDX-FileCopyrightText: Copyright © 2024 The Protobom Authors
3+
# SPDX-FileType: SOURCE
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
name: Release
7+
8+
on:
9+
push:
10+
tags: v*
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
16+
permissions:
17+
contents: write # needed to write releases
18+
19+
steps:
20+
- name: Set tag name
21+
shell: bash
22+
run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
23+
24+
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v3
25+
with:
26+
go-version-file: go.mod
27+
cache: false
28+
29+
- name: Check out code
30+
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
31+
with:
32+
fetch-depth: 1
33+
34+
- name: Install bom
35+
uses: kubernetes-sigs/release-actions/setup-bom@2f8b9ec22aedc9ce15039b6c7716aa6c2907df1c # v0.2.0
36+
37+
- name: Generate SBOM
38+
shell: bash
39+
run: bom generate --format=json -o /tmp/protobom-storage-$TAG.spdx.json .
40+
41+
- name: Publish Release
42+
uses: kubernetes-sigs/release-actions/publish-release@2f8b9ec22aedc9ce15039b6c7716aa6c2907df1c # v0.2.0
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
with:
46+
assets: /tmp/protobom-storage-$TAG.spdx.json
47+
sbom: false

0 commit comments

Comments
 (0)
Please sign in to comment.