From 992e8ee63b67558d74abe44f3942fb875836d578 Mon Sep 17 00:00:00 2001 From: Mikrz Date: Mon, 11 Nov 2024 16:36:27 -0500 Subject: [PATCH] Add package versions to the rpm and deb filenames --- build-packages.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/build-packages.sh b/build-packages.sh index df5dc7bb..d28b08c5 100755 --- a/build-packages.sh +++ b/build-packages.sh @@ -1,6 +1,7 @@ #!/bin/bash -VERSION=$(git describe --tags --always --match "[0-9][0-9][0-9][0-9].*.*") -echo $VERSION +TAG_VERSION=$(git describe --tags --always --match "[0-9][0-9][0-9][0-9].*.*") +OUT_VERSION=$(echo $TAG_VERSION | sed -E 's/([0-9]{4}\.[0-9]{1,2}\.[0-9]+-[0-9]+).*/\1/') +echo $TAG_VERSION # Disable FIPS module in go-boring export GOEXPERIMENT=noboringcrypto @@ -29,10 +30,10 @@ for arch in ${linuxArchs[@]}; do fi make cloudflared-deb - mv cloudflared\_$VERSION\_$arch.deb $ARTIFACT_DIR/cloudflared-linux-$arch.deb + mv cloudflared\_$TAG_VERSION\_$arch.deb $ARTIFACT_DIR/cloudflared-$OUT_VERSION-linux-$arch.deb # rpm packages invert the - and _ and use x86_64 instead of amd64. - RPMVERSION=$(echo $VERSION|sed -r 's/-/_/g') + RPMVERSION=$(echo $TAG_VERSION|sed -r 's/-/_/g') RPMARCH=$arch if [ $arch == "amd64" ];then RPMARCH="x86_64" @@ -41,8 +42,8 @@ for arch in ${linuxArchs[@]}; do RPMARCH="aarch64" fi make cloudflared-rpm - mv cloudflared-$RPMVERSION-1.$RPMARCH.rpm $ARTIFACT_DIR/cloudflared-linux-$RPMARCH.rpm + mv cloudflared-$RPMVERSION-1.$RPMARCH.rpm $ARTIFACT_DIR/cloudflared-$OUT_VERSION-linux-$RPMARCH.rpm # finally move the linux binary as well. - mv ./cloudflared $ARTIFACT_DIR/cloudflared-linux-$arch + mv ./cloudflared $ARTIFACT_DIR/cloudflared-$OUT_VERSION-linux-$arch done