Skip to content

Commit

Permalink
change to static linking when building so older Linux distributions a…
Browse files Browse the repository at this point in the history
…re supported (#5)
  • Loading branch information
tigerinus authored Aug 22, 2022
1 parent 472efd4 commit 516188d
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
sudo apt update
sudo apt-get --no-install-recommends --yes install \
libc6-dev-amd64-cross \
gcc-11-aarch64-linux-gnu libc6-dev-arm64-cross \
gcc-11-arm-linux-gnueabihf libc6-dev-armhf-cross
gcc-aarch64-linux-gnu libc6-dev-arm64-cross \
gcc-arm-linux-gnueabihf libc6-dev-armhf-cross
-
name: Checkout
uses: actions/checkout@v2
Expand Down
58 changes: 50 additions & 8 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ builds:
binary: build/sysroot/usr/bin/casaos-gateway
env:
- CGO_ENABLED=1
- CC=x86_64-linux-gnu-gcc-11
- CC=x86_64-linux-gnu-gcc
ldflags:
- -s
- -w
- -extldflags "-static"
tags:
- musl
- netgo
goos:
- linux
goarch:
Expand All @@ -22,7 +29,14 @@ builds:
binary: build/sysroot/usr/bin/casaos-gateway
env:
- CGO_ENABLED=1
- CC=aarch64-linux-gnu-gcc-11
- CC=aarch64-linux-gnu-gcc
ldflags:
- -s
- -w
- -extldflags "-static"
tags:
- musl
- netgo
goos:
- linux
goarch:
Expand All @@ -34,13 +48,20 @@ builds:
binary: build/sysroot/usr/bin/casaos-gateway
env:
- CGO_ENABLED=1
- CC=arm-linux-gnueabihf-gcc-11
- CC=arm-linux-gnueabihf-gcc
ldflags:
- -s
- -w
- -extldflags "-static"
tags:
- musl
- netgo
goos:
- linux
goarch:
- arm
goarm:
- 7
- "7"
hooks:
post:
- find build/sysroot -type f | xargs -L 1 realpath --relative-to=build/sysroot > build/sysroot.manifest
Expand All @@ -49,7 +70,14 @@ builds:
main: ./cmd/migration-tool
env:
- CGO_ENABLED=1
- CC=x86_64-linux-gnu-gcc-11
- CC=x86_64-linux-gnu-gcc
ldflags:
- -s
- -w
- -extldflags "-static"
tags:
- musl
- netgo
goos:
- linux
goarch:
Expand All @@ -59,7 +87,14 @@ builds:
main: ./cmd/migration-tool
env:
- CGO_ENABLED=1
- CC=aarch64-linux-gnu-gcc-11
- CC=aarch64-linux-gnu-gcc
ldflags:
- -s
- -w
- -extldflags "-static"
tags:
- musl
- netgo
goos:
- linux
goarch:
Expand All @@ -69,13 +104,20 @@ builds:
main: ./cmd/migration-tool
env:
- CGO_ENABLED=1
- CC=arm-linux-gnueabihf-gcc-11
- CC=arm-linux-gnueabihf-gcc
ldflags:
- -s
- -w
- -extldflags "-static"
tags:
- musl
- netgo
goos:
- linux
goarch:
- arm
goarm:
- 7
- "7"
archives:
- name_template: "{{ .Os }}-{{ .Arch }}-{{ .ProjectName }}-v{{ .Version }}"
id: casaos-gateway
Expand Down

0 comments on commit 516188d

Please sign in to comment.