Skip to content

Commit

Permalink
chore: add goreleaser build for test bins
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian committed Sep 20, 2024
1 parent 6a7c9bd commit a5dde8d
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
export CGO_CFLAGS
fi

if [ -z "${GOARCH}" ]; then
GOARCH=$(go env GOARCH)
export GOARCH
fi

export SEMVER
export GOTOOLCHAIN
export GOTOOLCHAIN_SEMVER
Expand Down
101 changes: 101 additions & 0 deletions .goreleaser-test-bins.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
project_name: node
version: 2
dist: ./.cache/goreleaser/test-bins
env:
- GO111MODULE=on
- CGO_ENABLED=1
builds:
- id: akash-darwin-amd64
binary: akash
main: ./cmd/akash
goarch:
- amd64
goos:
- darwin
env:
- CC=o64-clang
- CXX=o64-clang++
flags:
- "-mod={{ .Env.MOD }}"
- "-tags={{ .Env.BUILD_TAGS }}"
- -trimpath
ldflags:
- "{{ .Env.BUILD_VARS }}"
- "{{ .Env.STRIP_FLAGS }}"
- "-linkmode={{ .Env.LINKMODE }}"
- id: akash-darwin-arm64
binary: akash
main: ./cmd/akash
goarch:
- arm64
goos:
- darwin
env:
- CC=oa64-clang
- CXX=oa64-clang++
flags:
- "-mod={{ .Env.MOD }}"
- "-tags={{ .Env.BUILD_TAGS }}"
- -trimpath
ldflags:
- "{{ .Env.BUILD_VARS }}"
- "{{ .Env.STRIP_FLAGS }}"
- "-linkmode={{ .Env.LINKMODE }}"
- id: akash-linux-amd64
binary: akash
main: ./cmd/akash
env:
- CC=x86_64-linux-gnu-gcc
- CXX=x86_64-linux-gnu-g++
goarch:
- amd64
goos:
- linux
flags:
- "-mod={{ .Env.MOD }}"
- "-tags={{ .Env.BUILD_TAGS }}"
- -trimpath
ldflags:
- "{{ .Env.BUILD_VARS }}"
- "{{ .Env.STRIP_FLAGS }}"
- "-linkmode={{ .Env.LINKMODE }}"
- -extldflags "-lc -lrt -lpthread --static"
- id: akash-linux-arm64
binary: akash
main: ./cmd/akash
goarch:
- arm64
goos:
- linux
env:
- CC=aarch64-linux-gnu-gcc
- CXX=aarch64-linux-gnu-g++
flags:
- "-mod={{ .Env.MOD }}"
- "-tags={{ .Env.BUILD_TAGS }}"
- -trimpath
ldflags:
- "{{ .Env.BUILD_VARS }}"
- "{{ .Env.STRIP_FLAGS }}"
- "-linkmode={{ .Env.LINKMODE }}"
- -extldflags "-lc -lrt -lpthread --static"
universal_binaries:
- id: akash-darwin-universal
ids:
- akash-darwin-amd64
- akash-darwin-arm64
replace: true
name_template: "akash"

archives:
- id: wo/version
builds:
- akash-darwin-universal
- akash-linux-amd64
- akash-linux-arm64
name_template: "akash_{{ .Os }}_{{ .Arch }}"
wrap_in_directory: false
format: zip
files:
- none*

0 comments on commit a5dde8d

Please sign in to comment.