Skip to content

Commit 9dd0435

Browse files
authored
Fix GoReleaser Windows build (#2057)
1 parent 8142447 commit 9dd0435

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

.goreleaser.yaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ before:
55

66
builds:
77
- id: flow-cli
8+
binary: flow-cli
89
main: ./cmd/flow
910
goos:
1011
- darwin
@@ -14,26 +15,32 @@ builds:
1415
- amd64
1516
- arm64
1617
env:
17-
- CGO_CFLAGS=-O2 -D__BLST_PORTABLE__
18+
- CGO_CFLAGS=-O2 -D__BLST_PORTABLE__ -std=gnu11
1819
- CGO_ENABLED=1
20+
# Darwin
1921
- CC_darwin_amd64=o64-clang
20-
- CXX_darwin_amd64=o64-clang+
22+
- CXX_darwin_amd64=o64-clang++
2123
- CC_darwin_arm64=oa64-clang
2224
- CXX_darwin_arm64=oa64-clang++
25+
# Linux
2326
- CC_linux_amd64=x86_64-linux-gnu-gcc
2427
- CXX_linux_amd64=x86_64-linux-gnu-g++
2528
- CC_linux_arm64=aarch64-linux-gnu-gcc
2629
- CXX_linux_arm64=aarch64-linux-gnu-g++
27-
- CC_windows_amd64=x86_64-w64-mingw32-gcc
28-
- CXX_windows_amd64=x86_64-w64-mingw32-g++
30+
# Windows (llvm-mingw toolchains in cross image)
31+
- CC_windows_amd64=/llvm-mingw/bin/x86_64-w64-mingw32-gcc
32+
- CC_windows_amd64_v1=/llvm-mingw/bin/x86_64-w64-mingw32-gcc
33+
- CXX_windows_amd64=/llvm-mingw/bin/x86_64-w64-mingw32-g++
34+
- CXX_windows_amd64_v1=/llvm-mingw/bin/x86_64-w64-mingw32-g++
2935
- CC_windows_arm64=/llvm-mingw/bin/aarch64-w64-mingw32-gcc
3036
- CXX_windows_arm64=/llvm-mingw/bin/aarch64-w64-mingw32-g++
3137
- 'CC={{ index .Env (print "CC_" .Os "_" .Arch) }}'
3238
- 'CXX={{ index .Env (print "CXX_" .Os "_" .Arch) }}'
3339
flags:
3440
- -mod=readonly
3541
ldflags:
36-
- -X github.com/onflow/flow-cli/build.semver={{ .Env.VERSION }} -X github.com/onflow/flow-cli/internal/command.MixpanelToken={{ .Env.MIXPANEL_PROJECT_TOKEN }} -X github.com/onflow/flow-cli/internal/accounts.accountToken={{ .Env.LILICO_TOKEN }}
42+
- -X github.com/onflow/flow-cli/build.semver={{ .Env.VERSION }} -X github.com/onflow/flow-cli/build.commit={{ .ShortCommit }} -X github.com/onflow/flow-cli/internal/command.MixpanelToken={{ .Env.MIXPANEL_PROJECT_TOKEN }} -X github.com/onflow/flow-cli/internal/accounts.accountToken={{ .Env.LILICO_TOKEN }}
43+
3744

3845
archives:
3946
- id: golang-cross

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ $(BINARY):
5757
GO111MODULE=on go build \
5858
-trimpath \
5959
-ldflags \
60-
"-X github.com/onflow/flow-cli/build.semver=$(VERSION) -X github.com/onflow/flow-cli/internal/accounts.accountToken=${ACCOUNT_TOKEN} -X github.com/onflow/flow-cli/internal/command.MixpanelToken=${MIXPANEL_PROJECT_TOKEN}" \
60+
"-X github.com/onflow/flow-cli/build.semver=$(VERSION) -X github.com/onflow/flow-cli/build.commit=$(shell git rev-parse --short HEAD 2>/dev/null || echo dev) -X github.com/onflow/flow-cli/internal/accounts.accountToken=${ACCOUNT_TOKEN} -X github.com/onflow/flow-cli/internal/command.MixpanelToken=${MIXPANEL_PROJECT_TOKEN}" \
6161
-o $(BINARY) ./cmd/flow
6262

6363
.PHONY: versioned-binaries

0 commit comments

Comments
 (0)