cloudflare/cloudflared

Public

mirrored from https://github.com/cloudflare/cloudflaredAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
2022.6.3

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

build-packages.sh

49lines · modecode

1VERSION=$(git describe --tags --always --match "[0-9][0-9][0-9][0-9].*.*")
2echo $VERSION
3
4# Avoid depending on C code since we don't need it.
5export CGO_ENABLED=0
6
7# This controls the directory the built artifacts go into
8export ARTIFACT_DIR=built_artifacts/
9mkdir -p $ARTIFACT_DIR
10windowsArchs=("amd64" "386")
11export TARGET_OS=windows
12for arch in ${windowsArchs[@]}; do
13 export TARGET_ARCH=$arch
14 make cloudflared-msi
15 mv ./cloudflared.exe $ARTIFACT_DIR/cloudflared-windows-$arch.exe
16 mv cloudflared-$VERSION-$arch.msi $ARTIFACT_DIR/cloudflared-windows-$arch.msi
17done
18
19
20linuxArchs=("386" "amd64" "arm" "armhf" "arm64")
21export TARGET_OS=linux
22for arch in ${linuxArchs[@]}; do
23 unset TARGET_ARM
24 export TARGET_ARCH=$arch
25
26 ## Support for armhf builds
27 if [[ $arch == armhf ]] ; then
28 export TARGET_ARCH=arm
29 export TARGET_ARM=7
30 fi
31
32 make cloudflared-deb
33 mv cloudflared\_$VERSION\_$arch.deb $ARTIFACT_DIR/cloudflared-linux-$arch.deb
34
35 # rpm packages invert the - and _ and use x86_64 instead of amd64.
36 RPMVERSION=$(echo $VERSION|sed -r 's/-/_/g')
37 RPMARCH=$arch
38 if [ $arch == "amd64" ];then
39 RPMARCH="x86_64"
40 fi
41 if [ $arch == "arm64" ]; then
42 RPMARCH="aarch64"
43 fi
44 make cloudflared-rpm
45 mv cloudflared-$RPMVERSION-1.$RPMARCH.rpm $ARTIFACT_DIR/cloudflared-linux-$RPMARCH.rpm
46
47 # finally move the linux binary as well.
48 mv ./cloudflared $ARTIFACT_DIR/cloudflared-linux-$arch
49done
50