2021-11-09 11:37:51 +00:00
|
|
|
VERSION=$(git describe --tags --always --match "[0-9][0-9][0-9][0-9].*.*")
|
2021-07-30 11:29:51 +00:00
|
|
|
echo $VERSION
|
2021-11-09 11:37:51 +00:00
|
|
|
|
|
|
|
# Avoid depending on C code since we don't need it.
|
2021-07-28 09:08:20 +00:00
|
|
|
export CGO_ENABLED=0
|
2021-11-09 11:37:51 +00:00
|
|
|
|
2021-07-22 15:36:49 +00:00
|
|
|
# This controls the directory the built artifacts go into
|
|
|
|
export ARTIFACT_DIR=built_artifacts/
|
|
|
|
mkdir -p $ARTIFACT_DIR
|
|
|
|
windowsArchs=("amd64" "386")
|
|
|
|
export TARGET_OS=windows
|
2021-11-09 11:37:51 +00:00
|
|
|
for arch in ${windowsArchs[@]}; do
|
2021-07-22 15:36:49 +00:00
|
|
|
export TARGET_ARCH=$arch
|
|
|
|
make cloudflared-msi
|
2021-07-30 11:29:51 +00:00
|
|
|
mv ./cloudflared.exe $ARTIFACT_DIR/cloudflared-windows-$arch.exe
|
|
|
|
mv cloudflared-$VERSION-$arch.msi $ARTIFACT_DIR/cloudflared-windows-$arch.msi
|
2021-07-22 15:36:49 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
|
2022-06-20 11:05:03 +00:00
|
|
|
linuxArchs=("386" "amd64" "arm" "armhf" "arm64")
|
2021-07-22 15:36:49 +00:00
|
|
|
export TARGET_OS=linux
|
2021-11-09 11:37:51 +00:00
|
|
|
for arch in ${linuxArchs[@]}; do
|
2022-06-20 11:05:03 +00:00
|
|
|
unset TARGET_ARM
|
2021-07-22 15:36:49 +00:00
|
|
|
export TARGET_ARCH=$arch
|
2022-06-20 11:05:03 +00:00
|
|
|
|
|
|
|
## Support for armhf builds
|
|
|
|
if [[ $arch == armhf ]] ; then
|
|
|
|
export TARGET_ARCH=arm
|
|
|
|
export TARGET_ARM=7
|
|
|
|
fi
|
|
|
|
|
2021-07-22 15:36:49 +00:00
|
|
|
make cloudflared-deb
|
2021-07-30 11:29:51 +00:00
|
|
|
mv cloudflared\_$VERSION\_$arch.deb $ARTIFACT_DIR/cloudflared-linux-$arch.deb
|
|
|
|
|
2021-11-09 11:37:51 +00:00
|
|
|
# rpm packages invert the - and _ and use x86_64 instead of amd64.
|
2021-07-30 11:29:51 +00:00
|
|
|
RPMVERSION=$(echo $VERSION|sed -r 's/-/_/g')
|
|
|
|
RPMARCH=$arch
|
|
|
|
if [ $arch == "amd64" ];then
|
|
|
|
RPMARCH="x86_64"
|
|
|
|
fi
|
2021-08-04 07:18:43 +00:00
|
|
|
if [ $arch == "arm64" ]; then
|
|
|
|
RPMARCH="aarch64"
|
|
|
|
fi
|
2021-07-22 15:36:49 +00:00
|
|
|
make cloudflared-rpm
|
2021-07-30 11:29:51 +00:00
|
|
|
mv cloudflared-$RPMVERSION-1.$RPMARCH.rpm $ARTIFACT_DIR/cloudflared-linux-$RPMARCH.rpm
|
|
|
|
|
|
|
|
# finally move the linux binary as well.
|
|
|
|
mv ./cloudflared $ARTIFACT_DIR/cloudflared-linux-$arch
|
2021-07-22 15:36:49 +00:00
|
|
|
done
|