Skip to content

Commit

Permalink
fix: go releaser crosscompile with CGO support (#1588)
Browse files Browse the repository at this point in the history
* running via cross

* latest -> v1.20

* user root

* marking safe directory

* remove comment

* update image and releaser file

* update CC and CXX

---------

Co-authored-by: amitz <[email protected]>
  • Loading branch information
amitza and amitz authored Jul 24, 2024
1 parent c2b9b56 commit 1b38e55
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: 'release'
runs-on: ubuntu-latest
container:
image: goreleaser/goreleaser-cross:v1.20
image: goreleaser/goreleaser-cross:v1.22

permissions:
contents: write
Expand Down
44 changes: 35 additions & 9 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com

# The lines bellow are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
version: 2
project_name: lava

before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...

metadata:
Expand Down Expand Up @@ -45,6 +38,17 @@ builds:
- -mod=readonly
- -trimpath
mod_timestamp: "{{ .CommitTimestamp }}"
env:
- CC_darwin_amd64=o64-clang
- CXX_darwin_amd64=o64-clang++
- CC_darwin_arm64=oa64-clang
- CXX_darwin_arm64=oa64-clang++
- 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={{ index .Env (print "CC_" .Os "_" .Arch) }}'
- 'CXX={{ index .Env (print "CXX_" .Os "_" .Arch) }}'

- id: lavad
binary: lavad
Expand Down Expand Up @@ -81,6 +85,17 @@ builds:
- netgo
- ledger
mod_timestamp: "{{ .CommitTimestamp }}"
env:
- CC_darwin_amd64=o64-clang
- CXX_darwin_amd64=o64-clang++
- CC_darwin_arm64=oa64-clang
- CXX_darwin_arm64=oa64-clang++
- 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={{ index .Env (print "CC_" .Os "_" .Arch) }}'
- 'CXX={{ index .Env (print "CXX_" .Os "_" .Arch) }}'

- id: lavap
binary: lavap
Expand All @@ -107,6 +122,17 @@ builds:
- -mod=readonly
- -trimpath
mod_timestamp: "{{ .CommitTimestamp }}"
env:
- CC_darwin_amd64=o64-clang
- CXX_darwin_amd64=o64-clang++
- CC_darwin_arm64=oa64-clang
- CXX_darwin_arm64=oa64-clang++
- 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={{ index .Env (print "CC_" .Os "_" .Arch) }}'
- 'CXX={{ index .Env (print "CXX_" .Os "_" .Arch) }}'

archives:
- id: lavavisor
Expand Down

0 comments on commit 1b38e55

Please sign in to comment.