-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
71dc2e0
commit 8794d22
Showing
3 changed files
with
48 additions
and
15 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 |
---|---|---|
|
@@ -4,4 +4,5 @@ CHANGELOG.md | |
dist | ||
commitlog | ||
lab | ||
api_urls.json | ||
api_urls.json | ||
bin |
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
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,39 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euxo pipefail | ||
|
||
rm -rf ./bin | ||
|
||
build_commands=(' | ||
apk add make curl git \ | ||
; GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o bin/linux-arm64/alvu \ | ||
; GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o bin/linux-amd64/alvu \ | ||
; GOOS=linux GOARCH=arm go build -ldflags="-s -w" -o bin/linux-arm/alvu \ | ||
; GOOS=windows GOARCH=386 go build -ldflags="-s -w" -o bin/windows-386/alvu \ | ||
; GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o bin/windows-amd64/alvu \ | ||
; GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o bin/darwin-amd64/alvu \ | ||
; GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o bin/darwin-arm64/alvu | ||
') | ||
|
||
# run a docker container with osxcross and cross compile everything | ||
docker run -it --rm -v $(pwd):/usr/local/src -w /usr/local/src \ | ||
golang:alpine3.16 \ | ||
sh -c "$build_commands" | ||
|
||
# create archives | ||
cd bin | ||
for dir in $(ls -d *); | ||
do | ||
cp ../README.md $dir | ||
cp ../LICENSE $dir | ||
mkdir -p $dir/docs | ||
cp -r ../docs/* $dir/docs | ||
|
||
# remove the download document and styles | ||
rm -rf $dir/docs/download.md | ||
rm -rf $dir/docs/styles.css | ||
|
||
tar cfzv "$dir".tgz $dir | ||
rm -rf $dir | ||
done | ||
cd .. |