-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ inputs: | |
tag: | ||
description: 'Tag to upload artifacts to.' | ||
required: true | ||
|
||
outputs: | ||
hashes: | ||
description: sha256sum hashes of built artifacts | ||
|
@@ -32,6 +33,14 @@ runs: | |
shell: bash | ||
run: | | ||
echo $DOCKER_TOKEN | docker login --username $DOCKER_USERNAME --password-stdin | ||
- uses: goto-bus-stop/[email protected] | ||
with: | ||
version: 0.14.0 | ||
|
||
- run: sudo apt-get install gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf | ||
shell: bash | ||
|
||
- name: Run Goreleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
env: | ||
- CGO_ENABLED=1 | ||
builds: | ||
- &default_config | ||
id: ldcli-linux_amd64 | ||
binary: ldcli | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
ldflags: | ||
- -s | ||
- -w | ||
env: | ||
- CC=x86_64-linux-gnu-gcc | ||
- CXX=x86_64-linux-gnu-g++ | ||
- <<: *default_config | ||
id: ldcli-linux_arm64 | ||
goarch: | ||
- arm64 | ||
env: | ||
- CC=aarch64-linux-gnu-gcc | ||
- CXX=aarch64-linux-gnu-gcc | ||
- <<: *default_config | ||
id: ldcli-linux_armhf | ||
goarm: | ||
- "7" | ||
goarch: | ||
- arm | ||
env: | ||
- CC=arm-linux-gnueabihf-gcc | ||
- CXX=arm-linux-gnueabihf-g++ | ||
- <<: *default_config | ||
id: ldcli-darwin_amd64 | ||
goarch: | ||
- amd64 | ||
env: | ||
- CC=o64-clang | ||
- CXX=o64-clang++ | ||
- <<: *default_config | ||
id: ldcli-darwin_arm64 | ||
goarch: | ||
- arm64 | ||
env: | ||
- CC=oa64-clang | ||
- CXX=oa64-clang++ | ||
- <<: *default_config | ||
id: ldcli-windows_amd64 | ||
goarch: | ||
- amd64 | ||
env: | ||
- CC=x86_64-w64-mingw32-gcc | ||
- CXX=x86_64-w64-mingw32-g++ | ||
- <<: *default_config | ||
id: ldcli-windows_arm64 | ||
goarch: | ||
- arm64 | ||
env: | ||
- CC=/llvm-mingw/bin/aarch64-w64-mingw32-gcc | ||
- CXX=/llvm-mingw/bin/aarch64-w64-mingw32-g++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
env: | ||
- CGO_ENABLED=1 | ||
builds: | ||
- &default_config | ||
id: ldcli-linux_amd64 | ||
binary: ldcli | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
ldflags: | ||
- -s | ||
- -w | ||
- -extldflags=-static | ||
flags: | ||
- -trimpath | ||
tags: | ||
- osusergo | ||
- netgo | ||
- sqlite_omit_load_extension | ||
env: | ||
- CC=zig cc -target x86_64-linux-musl | ||
- CXX=zig c++ -target x86_64-linux-musl | ||
- <<: *default_config | ||
id: ldcli-linux_arm64 | ||
goarch: | ||
- arm64 | ||
env: | ||
- CC=zig cc -target aarch64-linux-musl | ||
- CXX=zig c++ -target aarch64-linux-musl | ||
- <<: *default_config | ||
id: ldcli-linux_armhf | ||
goarm: | ||
- "7" | ||
goarch: | ||
- arm | ||
env: | ||
- CC=zig cc -target arm-linux-musl | ||
- CXX=zig c++ -target arm-linux-musl | ||
- <<: *default_config | ||
id: ldcli-darwin_amd64 | ||
goarch: | ||
- amd64 | ||
flags: | ||
- -trimpath | ||
- -buildmode=pie | ||
env: | ||
- CC=zig cc -target x86_64-macos-none | ||
- CXX=zig c++ -target x86_64-macos-none | ||
- <<: *default_config | ||
id: ldcli-darwin_arm64 | ||
goarch: | ||
- arm64 | ||
flags: | ||
- -trimpath | ||
- -buildmode=pie | ||
env: | ||
- CC=zig cc -target aarch64-macos-none | ||
- CXX=zig c++ -target aarch64-macos-none | ||
- <<: *default_config | ||
id: ldcli-windows_amd64 | ||
goarch: | ||
- amd64 | ||
env: | ||
- CC=zig cc -target x86_64-windows-gnu | ||
- CXX=zig c++ -target x86_64-windows-gnu | ||
- <<: *default_config | ||
id: ldcli-windows_arm64 | ||
goarch: | ||
- arm64 | ||
env: | ||
- CC=zig cc -target aarch64-windows-gnu | ||
- CXX=zig c++ -target aarch64-windows-gnu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu | ||
|
||
# based on https://github.com/goreleaser/goreleaser-cross | ||
docker image inspect grcross-xbuilder &>/dev/null || docker build -t grcross-xbuilder -f - . <<EOF | ||
FROM ghcr.io/goreleaser/goreleaser-cross:latest | ||
RUN set -eux; \ | ||
apt update; \ | ||
apt-get install libc6-dev libc6-dev-i386 musl-tools musl-dev -y | ||
EOF | ||
|
||
exec docker run -it --rm -v "$PWD:$PWD" -w "$PWD" grcross-xbuilder build --snapshot --clean --config .goreleaser.grcross.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu | ||
|
||
# based on https://github.com/goreleaser/goreleaser-example-zig-cgo/tree/master | ||
docker image inspect zig-xbuilder &>/dev/null || docker build -t zig-xbuilder -f - . <<EOF | ||
FROM ghcr.io/goreleaser/goreleaser-cross:latest AS gr_cross | ||
FROM golang:1.22-bullseye | ||
ENV PATH="$PATH:/usr/local/share/zig-linux-x86_64-0.14.0-dev.1021+fc2924080:/go/bin:/usr/local/go/bin" | ||
COPY --from=gr_cross /usr/local/osxcross/SDK/MacOSX12.0.sdk/System/Library/Frameworks /host/Frameworks | ||
RUN set -eux; \ | ||
apt update; \ | ||
apt install xz-utils bash -y; \ | ||
wget -q -O- https://ziglang.org/builds/zig-linux-x86_64-0.14.0-dev.1021+fc2924080.tar.xz | tar -Jxf - -C /usr/local/share/; \ | ||
zig version; \ | ||
curl -sfL -o- https://github.com/goreleaser/goreleaser/releases/download/v2.1.0/goreleaser_Linux_x86_64.tar.gz | tar -zxf - -C /usr/local/bin/; \ | ||
go version; \ | ||
goreleaser --version | ||
EOF | ||
|
||
exec docker run -v "$PWD:$PWD:z" -w "$PWD" -it --rm --entrypoint /usr/local/bin/goreleaser zig-xbuilder build --snapshot --clean --config .goreleaser.zig.yaml |