1
0
mirror of https://github.com/drone/drone-cli.git synced 2024-11-23 09:21:56 +01:00
drone-cli/.drone.sh

26 lines
1.4 KiB
Bash
Raw Permalink Normal View History

2016-05-25 18:43:33 +02:00
#!/bin/sh
set -e
set -x
2017-05-22 15:18:17 +02:00
# disable CGO for cross-compiling
export CGO_ENABLED=0
# compile for all architectures
GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=${DRONE_TAG##v}" -o release/linux/amd64/drone ./drone
GOOS=linux GOARCH=arm64 go build -ldflags "-X main.version=${DRONE_TAG##v}" -o release/linux/arm64/drone ./drone
GOOS=linux GOARCH=ppc64le go build -ldflags "-X main.version=${DRONE_TAG##v}" -o release/linux/ppc64le/drone ./drone
GOOS=linux GOARCH=arm go build -ldflags "-X main.version=${DRONE_TAG##v}" -o release/linux/arm/drone ./drone
GOOS=windows GOARCH=amd64 go build -ldflags "-X main.version=${DRONE_TAG##v}" -o release/windows/amd64/drone.exe ./drone
GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.version=${DRONE_TAG##v}" -o release/darwin/amd64/drone ./drone
2016-05-25 18:43:33 +02:00
# tar binary files prior to upload
2017-05-22 15:18:17 +02:00
tar -cvzf release/drone_linux_amd64.tar.gz -C release/linux/amd64 drone
tar -cvzf release/drone_linux_arm64.tar.gz -C release/linux/arm64 drone
tar -cvzf release/drone_linux_ppc64le.tar.gz -C release/linux/ppc64le drone
2017-05-22 15:18:17 +02:00
tar -cvzf release/drone_linux_arm.tar.gz -C release/linux/arm drone
tar -cvzf release/drone_windows_amd64.tar.gz -C release/windows/amd64 drone.exe
2017-05-22 15:18:17 +02:00
tar -cvzf release/drone_darwin_amd64.tar.gz -C release/darwin/amd64 drone
2016-05-25 18:43:33 +02:00
# generate shas for tar files
2017-05-22 15:18:17 +02:00
sha256sum release/*.tar.gz > release/drone_checksums.txt