Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: first pass at go releaser bits for clabverter #139

Merged
merged 2 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,25 @@ jobs:

helm package charts/clabernetes --version $RELEASE_VERSION
helm push clabernetes-$RELEASE_VERSION.tgz oci://ghcr.io/srl-labs/clabernetes

- name: run goreleaser to build clabverter/checksums
uses: goreleaser/goreleaser-action@v5
with:
version: latest
carlmontanari marked this conversation as resolved.
Show resolved Hide resolved
args: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# simply use gh cli to upload since we dont actually want an action that makes the release
# for us, just wanna upload assets
- name: upload clabverter binaries (and checksums) to the release
run: |
cd .dist
gh release upload ${{ github.ref_name }} checksums.txt
for filename in *.tar.gz; do
[ -e "$filename" ] || continue
gh release upload ${{ github.ref_name }} "$filename"
done
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ cover.out

# direnv file
.envrc

# goreleaser dist dir for testing builds and such locally
.dist/
35 changes: 35 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
version: 1

dist: ./.dist

checksum:
name_template: checksums.txt

builds:
- id: clabverter
binary: clabverter
main: ./cmd/clabverter/main.go
env:
- CGO_ENABLED=0
goos:
- linux
- darwin

archives:
- format: tar.gz
name_template: >-
{{ .ProjectName }}_
{{- .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
format_overrides:
- goos: windows
format: zip

# we just wanna build/archive w/ goreleaser, disable changelog/release bits
changelog:
disable: true
release:
disable: true