cloudflare/cloudflared

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
2024.4.1

Branches

Tags

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

Clone

HTTPS

Download ZIP

build-packages.sh

48lines · modecode

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