Skip to content

Commit d822a6c

Browse files
committed
feat: first pass at go releaser bits for clabverter
1 parent 7885fb7 commit d822a6c

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

.github/workflows/release.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,25 @@ jobs:
7979
8080
helm package charts/clabernetes --version $RELEASE_VERSION
8181
helm push clabernetes-$RELEASE_VERSION.tgz oci://ghcr.io/srl-labs/clabernetes
82+
83+
- name: run goreleaser to build clabverter/checksums
84+
uses: goreleaser/goreleaser-action@v5
85+
with:
86+
version: latest
87+
args: release
88+
env:
89+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
91+
# simply use gh cli to upload since we dont actually want an action that makes the release
92+
# for us, just wanna upload assets
93+
- name: upload clabverter binaries (and checksums) to the release
94+
run: |
95+
cd .dist
96+
gh release upload ${{ github.ref_name }} checksums.txt
97+
for filename in *.tar.gz; do
98+
[ -e "$filename" ] || continue
99+
gh release upload ${{ github.ref_name }} "$filename"
100+
done
101+
env:
102+
GITHUB_TOKEN: ${{ github.TOKEN }}
103+
shell: bash

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@ cover.out
3737

3838
# direnv file
3939
.envrc
40+
41+
# goreleaser dist dir for testing builds and such locally
42+
.dist/

.goreleaser.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
version: 1
3+
4+
dist: ./.dist
5+
6+
checksum:
7+
name_template: checksums.txt
8+
9+
builds:
10+
- id: clabverter
11+
binary: clabverter
12+
main: ./cmd/clabverter/main.go
13+
env:
14+
- CGO_ENABLED=0
15+
goos:
16+
- linux
17+
- darwin
18+
19+
archives:
20+
- format: tar.gz
21+
name_template: >-
22+
{{ .ProjectName }}_
23+
{{- .Os }}_
24+
{{- if eq .Arch "amd64" }}x86_64
25+
{{- else if eq .Arch "386" }}i386
26+
{{- else }}{{ .Arch }}{{ end }}
27+
format_overrides:
28+
- goos: windows
29+
format: zip
30+
31+
# we just wanna build/archive w/ goreleaser, disable changelog/release bits
32+
changelog:
33+
disable: true
34+
release:
35+
disable: true

0 commit comments

Comments
 (0)