From 7de266f52ffe8ea9ecb81b627ad57eadf7a5b894 Mon Sep 17 00:00:00 2001 From: Jordan Ribbink Date: Thu, 22 Feb 2024 10:02:23 -0800 Subject: [PATCH] try other conditional env approach --- .github/workflows/build-release.yaml | 2 -- .goreleaser.yaml | 29 +++++++++++++++------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 57d113f07..31734c028 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -28,8 +28,6 @@ jobs: echo 'BUILD_TIME=$(date --iso-8601=seconds)' >> .release-env echo 'VERSION=${{ github.ref_name }}' >> .release-env echo 'COMMIT=${{ github.sha }}' >> .release-env - echo 'CGO_FLAGS="-O2 -D__BLST_PORTABLE__"' >> .release-env - echo 'CGO_ENABLED=1' >> .release-env echo 'GITHUB_TOKEN=${{ secrets.FLOW_CLI_RELEASE }}' >> .release-env - name: Build and Release run: make release \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 3a8de2cdf..071526d4e 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -12,19 +12,22 @@ builds: - amd64 - arm64 env: - - >- - {{- if eq .Os "darwin" }} - {{- if eq .Arch "amd64"}}CC=o64-clang CXX=o64-clang++{{- end }} - {{- if eq .Arch "arm64"}}CC=oa64-clang CXX=oa64-clang++{{- end }} - {{- end }} - {{ if eq .Os "linux" }} - {{- if eq .Arch "amd64" }}CC=x86_64-linux-gnu-gcc CXX=x86_64-linux-gnu-g++{{- end }} - {{- if eq .Arch "arm64" }}CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++{{- end }} - {{- end }} - {{- if eq .Os "windows" }} - {{- if eq .Arch "amd64" }}CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++{{- end }} - {{- if eq .Arch "arm64" }}CC=aarch64-w64-mingw32-gcc CXX=aarch64-w64-mingw32-g++{{- end }} - {{- end }} + - CGO_FLAGS="-O2 -D__BLST_PORTABLE__" + - CGO_ENABLED=1 + - CC_darwin_amd64=o64-clang + - CXX_darwin_amd64=o64-clang+ + - CC_darwin_arm64=oa64-clang + - CXX_darwin_arm64=oa64-clang++ + - CC_linux_amd64=x86_64-linux-gnu-gcc + - CXX_linux_amd64=x86_64-linux-gnu-g++ + - CC_linux_arm64=aarch64-linux-gnu-gcc + - CXX_linux_arm64=aarch64-linux-gnu-g++ + - CC_windows_amd64=x86_64-w64-mingw32-gcc + - CXX_windows_amd64=x86_64-w64-mingw32-g++ + - CC_windows_arm64=aarch64-w64-mingw32-gcc + - CXX_windows_arm64=aarch64-w64-mingw32-g++ + - 'CC={{ index .Env (print "CC_" .Os "_" .Arch) }}' + - 'CXX={{ index .Env (print "CXX_" .Os "_" .Arch) }}' flags: - -mod=readonly ldflags: