cloudflare/cloudflared

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
2021.10.5

Branches

Tags

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

Clone

HTTPS

Download ZIP

build-packages.sh

40lines · modecode

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