2021-08-07 17:06:39 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -x
|
|
|
|
set -e
|
|
|
|
|
2024-05-27 14:50:57 -07:00
|
|
|
export CGO_ENABLED=1
|
|
|
|
export CC=musl-gcc
|
|
|
|
|
|
|
|
FLAGS="-s -w -linkmode=external -extldflags=-static -X gitlab.com/offline-twitter/twitter_offline_engine/internal/webserver.use_embedded=true"
|
|
|
|
|
2022-01-04 12:57:43 -05:00
|
|
|
if [[ -n "$1" ]]; then
|
2024-05-27 14:50:57 -07:00
|
|
|
go build -ldflags="$FLAGS -X main.version_string=$1" -o tw ./twitter
|
2022-01-04 12:57:43 -05:00
|
|
|
else
|
2024-05-27 14:50:57 -07:00
|
|
|
go build -ldflags="$FLAGS" -o tw ./twitter
|
2022-01-04 12:57:43 -05:00
|
|
|
fi
|
2021-08-07 17:06:39 -07:00
|
|
|
chmod +x tw
|