Skip to content

Commit

Permalink
Merge pull request #139 from srl-labs/feat/build-clabverter
Browse files Browse the repository at this point in the history
feat: first pass at go releaser bits for clabverter
  • Loading branch information
carlmontanari authored Apr 1, 2024
2 parents 7885fb7 + a2d845c commit 0ef4003
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/vars.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ GOFUMPT_VERSION=v0.6.0
GOLANGCI_LINT_VERSION=v1.57.1
GOLINES_VERSION=v0.12.2
GOTESTSUM_VERSION=v1.11.0
HELM_VERSION=v3.14.2
HELM_VERSION=v3.14.2
GORELEASER_VERSION=v1.24.0
23 changes: 23 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
echo "GOLINES_VERSION=$GOLINES_VERSION" >> "$GITHUB_ENV"
echo "GOTESTSUM_VERSION=$GOTESTSUM_VERSION" >> "$GITHUB_ENV"
echo "HELM_VERSION=$HELM_VERSION" >> "$GITHUB_ENV"
echo "GORELEASER_VERSION=$GORELEASER_VERSION" >> "$GITHUB_ENV"
- name: install devspace
run: |
Expand Down Expand Up @@ -79,3 +80,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: ${{ env.GORELEASER_VERSION }}
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

0 comments on commit 0ef4003

Please sign in to comment.