Skip to content

Commit b655e5e

Browse files
authored
Merge pull request #11 from pjbgf-forks/fixes
Add release workflow
2 parents 4d902c1 + d8a3a42 commit b655e5e

File tree

4 files changed

+98
-1
lines changed

4 files changed

+98
-1
lines changed

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions: {}
9+
10+
jobs:
11+
goreleaser:
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
contents: write # create GH releases
16+
id-token: write # ephemeral keys (a.k.a. "keyless") signing
17+
attestations: write # write GH attestations
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@cbb722410c2e876e24abbe8de2cc27693e501dcb # v4.2.2
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Set up Go
26+
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
27+
with:
28+
go-version: stable
29+
30+
- uses: anchore/sbom-action/download-syft@55dc4ee22412511ee8c3142cbea40418e6cec693 # v0.17.8
31+
- uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
32+
33+
- name: Run GoReleaser
34+
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
35+
with:
36+
distribution: goreleaser
37+
version: '~> v2'
38+
args: release --clean
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
42+
- name: Attest release artefacts
43+
uses: actions/attest-build-provenance@ef244123eb79f2f7a7e75d99086184180e6d0018 # v1.4.4
44+
with:
45+
subject-path: "dist/slsactl*"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.vscode/
22
build/
3+
dist/

.goreleaser.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
version: 2
2+
project_name: slsactl
3+
builds:
4+
- id: slsactl
5+
binary: slsactl
6+
main: main.go
7+
flags:
8+
- -trimpath
9+
ldflags:
10+
- -s -w
11+
- -X github.com/slsactl/cmd/cmd.version={{.Version}}
12+
goos:
13+
- linux
14+
- windows
15+
- darwin
16+
goarch:
17+
- amd64
18+
- arm64
19+
env:
20+
- CGO_ENABLED=0
21+
22+
archives:
23+
- id: default
24+
format: binary
25+
26+
signs:
27+
- cmd: cosign
28+
certificate: '${artifact}.pem'
29+
args:
30+
- sign-blob
31+
- '--yes'
32+
- '--output-signature=${signature}'
33+
- '--output-certificate=${certificate}'
34+
- '--bundle=${artifact}.bundle'
35+
- '${artifact}'
36+
artifacts: checksum
37+
output: true
38+
39+
source:
40+
enabled: true
41+
name_template: '{{ .ProjectName }}_{{ .Version }}_source'
42+
43+
sboms:
44+
- id: source
45+
artifacts: source
46+
documents:
47+
- '{{ .ProjectName }}_{{ .Version }}_sbom.spdx.json'
48+
49+
release:
50+
extra_files:
51+
- glob: ./**/*.bundle

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ test:
1111
verify: verify-lint verify-dirty ## Run verification checks.
1212

1313
verify-lint: $(GOLANGCI)
14-
$(GOLANGCI) run --timeout 2m
14+
$(GOLANGCI) run --timeout 10m

0 commit comments

Comments
 (0)