Skip to content

Commit 992e8ee

Browse files
committed
Add package versions to the rpm and deb filenames
1 parent 1f3e304 commit 992e8ee

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

build-packages.sh

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
2-
VERSION=$(git describe --tags --always --match "[0-9][0-9][0-9][0-9].*.*")
3-
echo $VERSION
2+
TAG_VERSION=$(git describe --tags --always --match "[0-9][0-9][0-9][0-9].*.*")
3+
OUT_VERSION=$(echo $TAG_VERSION | sed -E 's/([0-9]{4}\.[0-9]{1,2}\.[0-9]+-[0-9]+).*/\1/')
4+
echo $TAG_VERSION
45

56
# Disable FIPS module in go-boring
67
export GOEXPERIMENT=noboringcrypto
@@ -29,10 +30,10 @@ for arch in ${linuxArchs[@]}; do
2930
fi
3031

3132
make cloudflared-deb
32-
mv cloudflared\_$VERSION\_$arch.deb $ARTIFACT_DIR/cloudflared-linux-$arch.deb
33+
mv cloudflared\_$TAG_VERSION\_$arch.deb $ARTIFACT_DIR/cloudflared-$OUT_VERSION-linux-$arch.deb
3334

3435
# rpm packages invert the - and _ and use x86_64 instead of amd64.
35-
RPMVERSION=$(echo $VERSION|sed -r 's/-/_/g')
36+
RPMVERSION=$(echo $TAG_VERSION|sed -r 's/-/_/g')
3637
RPMARCH=$arch
3738
if [ $arch == "amd64" ];then
3839
RPMARCH="x86_64"
@@ -41,8 +42,8 @@ for arch in ${linuxArchs[@]}; do
4142
RPMARCH="aarch64"
4243
fi
4344
make cloudflared-rpm
44-
mv cloudflared-$RPMVERSION-1.$RPMARCH.rpm $ARTIFACT_DIR/cloudflared-linux-$RPMARCH.rpm
45+
mv cloudflared-$RPMVERSION-1.$RPMARCH.rpm $ARTIFACT_DIR/cloudflared-$OUT_VERSION-linux-$RPMARCH.rpm
4546

4647
# finally move the linux binary as well.
47-
mv ./cloudflared $ARTIFACT_DIR/cloudflared-linux-$arch
48+
mv ./cloudflared $ARTIFACT_DIR/cloudflared-$OUT_VERSION-linux-$arch
4849
done

0 commit comments

Comments
 (0)