WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 4159ba7

Browse files
committed
do static builds of croc
following golang/go#26492 (comment)
1 parent 8ac1e3a commit 4159ba7

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
go-version: '1.20'
2121
- name: Build Windows 7
2222
run: |
23-
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o croc.exe
23+
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -tags netgo -ldflags '-H=windowsgui -extldflags "-static"' -o croc.exe
2424
zip croc_${{ github.event.release.name }}_Windows7-64bit.zip croc.exe
25-
GOOS=windows GOARCH=386 go build -ldflags="-s -w" -o croc.exe
25+
CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -tags netgo -ldflags '-H=windowsgui -extldflags "-static"' -o croc.exe
2626
zip croc_${{ github.event.release.name }}_Windows7-32bit.zip croc.exe
2727
- name: Setup Go
2828
uses: actions/setup-go@v4
@@ -35,28 +35,25 @@ jobs:
3535
cd .. && tar -czvf croc_${{ github.event.release.name }}_src.tar.gz croc-${{ github.event.release.name }}
3636
- name: Build files
3737
run: |
38-
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o croc.exe
38+
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -tags netgo -ldflags '-H=windowsgui -extldflags "-static"' -o croc.exe
3939
zip croc_${{ github.event.release.name }}_Windows-64bit.zip croc.exe
40-
GOOS=windows GOARCH=386 go build -ldflags="-s -w" -o croc.exe
40+
CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -tags netgo -ldflags '-H=windowsgui -extldflags "-static"' -o croc.exe
4141
zip croc_${{ github.event.release.name }}_Windows-32bit.zip croc.exe
42-
GOOS=windows GOARCH=arm go build -ldflags="-s -w" -o croc.exe
42+
CGO_ENABLED=0 GOOS=windows GOARCH=arm go build -tags netgo -ldflags '-H=windowsgui -extldflags "-static"' -o croc.exe
4343
zip croc_${{ github.event.release.name }}_Windows-ARM.zip croc.exe
44-
GOOS=windows GOARCH=arm64 go build -ldflags="-s -w" -o croc.exe
44+
CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -tags netgo -ldflags '-H=windowsgui -extldflags "-static"' -o croc.exe
4545
zip croc_${{ github.event.release.name }}_Windows-ARM64.zip croc.exe
46-
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o croc
47-
upx --brute croc
46+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -tags netgo -ldflags '-extldflags "-static"' -o croc
4847
tar -czvf croc_${{ github.event.release.name }}_Linux-64bit.tar.gz croc
49-
GOOS=linux GOARCH=386 go build -ldflags="-s -w" -o croc
48+
CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -tags netgo -ldflags '-extldflags "-static"' -o croc
5049
tar -czvf croc_${{ github.event.release.name }}_Linux-32bit.tar.gz croc
51-
GOOS=linux GOARCH=arm go build -ldflags="-s -w" -o croc
52-
upx --brute croc
50+
CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -tags netgo -ldflags '-extldflags "-static"' -o croc
5351
tar -czvf croc_${{ github.event.release.name }}_Linux-ARM.tar.gz croc
54-
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o croc
55-
upx --brute croc
52+
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -tags netgo -ldflags '-extldflags "-static"' -o croc
5653
tar -czvf croc_${{ github.event.release.name }}_Linux-ARM64.tar.gz croc
57-
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o croc
54+
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags '-s -extldflags "-sectcreate __TEXT __info_plist Info.plist"' -o croc
5855
tar -czvf croc_${{ github.event.release.name }}_macOS-64bit.tar.gz croc
59-
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o croc
56+
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags '-s -extldflags "-sectcreate __TEXT __info_plist Info.plist"' -o croc
6057
tar -czvf croc_${{ github.event.release.name }}_macOS-ARM64.tar.gz croc
6158
- name: Create checksums.txt
6259
run: |

0 commit comments

Comments
 (0)