2019-04-06 19:32:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
|
|
|
# disable CGO for cross-compiling
|
|
|
|
export CGO_ENABLED=0
|
|
|
|
|
|
|
|
# compile for all architectures
|
2019-08-27 11:01:29 +00:00
|
|
|
GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=${DRONE_TAG##v}" -o cli/release/linux/amd64/woodpecker github.com/laszlocph/woodpecker/cli/woodpecker
|
|
|
|
GOOS=linux GOARCH=arm64 go build -ldflags "-X main.version=${DRONE_TAG##v}" -o cli/release/linux/arm64/woodpecker github.com/laszlocph/woodpecker/cli/woodpecker
|
|
|
|
GOOS=linux GOARCH=arm go build -ldflags "-X main.version=${DRONE_TAG##v}" -o cli/release/linux/arm/woodpecker github.com/laszlocph/woodpecker/cli/woodpecker
|
|
|
|
GOOS=windows GOARCH=amd64 go build -ldflags "-X main.version=${DRONE_TAG##v}" -o cli/release/windows/amd64/woodpecker github.com/laszlocph/woodpecker/cli/woodpecker
|
|
|
|
GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.version=${DRONE_TAG##v}" -o cli/release/darwin/amd64/woodpecker github.com/laszlocph/woodpecker/cli/woodpecker
|
2019-04-06 19:32:14 +00:00
|
|
|
|
|
|
|
# tar binary files prior to upload
|
2019-08-27 11:01:29 +00:00
|
|
|
tar -cvzf cli/release/woodpecker_linux_amd64.tar.gz -C cli/release/linux/amd64 woodpecker
|
|
|
|
tar -cvzf cli/release/woodpecker_linux_arm64.tar.gz -C cli/release/linux/arm64 woodpecker
|
|
|
|
tar -cvzf cli/release/woodpecker_linux_arm.tar.gz -C cli/release/linux/arm woodpecker
|
|
|
|
tar -cvzf cli/release/woodpecker_windows_amd64.tar.gz -C cli/release/windows/amd64 woodpecker
|
|
|
|
tar -cvzf cli/release/woodpecker_darwin_amd64.tar.gz -C cli/release/darwin/amd64 woodpecker
|
2019-04-06 19:32:14 +00:00
|
|
|
|
|
|
|
# generate shas for tar files
|
2019-08-27 11:01:29 +00:00
|
|
|
sha256sum cli/release/*.tar.gz > cli/release/woodpecker_checksums.txt
|