cloudflare/cloudflared

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
2023.7.3

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 --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
10
11linuxArchs=("386" "amd64" "arm" "armhf" "arm64")
12export TARGET_OS=linux
13for arch in ${linuxArchs[@]}; do
14 unset TARGET_ARM
15 export TARGET_ARCH=$arch
16
17 ## Support for armhf builds
18 if [[ $arch == armhf ]] ; then
19 export TARGET_ARCH=arm
20 export TARGET_ARM=7
21 fi
22
23 make cloudflared-deb
24 mv cloudflared\_$VERSION\_$arch.deb $ARTIFACT_DIR/cloudflared-linux-$arch.deb
25
26 # rpm packages invert the - and _ and use x86_64 instead of amd64.
27 RPMVERSION=$(echo $VERSION|sed -r 's/-/_/g')
28 RPMARCH=$arch
29 if [ $arch == "amd64" ];then
30 RPMARCH="x86_64"
31 fi
32 if [ $arch == "arm64" ]; then
33 RPMARCH="aarch64"
34 fi
35 make cloudflared-rpm
36 mv cloudflared-$RPMVERSION-1.$RPMARCH.rpm $ARTIFACT_DIR/cloudflared-linux-$RPMARCH.rpm
37
38 # finally move the linux binary as well.
39 mv ./cloudflared $ARTIFACT_DIR/cloudflared-linux-$arch
40done
41