summaryrefslogtreecommitdiffhomepage
path: root/ci
diff options
context:
space:
mode:
Diffstat (limited to 'ci')
-rwxr-xr-xci/buildserver-build.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/ci/buildserver-build.sh b/ci/buildserver-build.sh
index 1902a4a6ad..05be2a7588 100755
--- a/ci/buildserver-build.sh
+++ b/ci/buildserver-build.sh
@@ -70,6 +70,7 @@ upload_pdb() {
build_ref() {
ref=$1
+ tag=${2:-""}
current_hash="$(git rev-parse $ref^{commit})"
if [ -f "$LAST_BUILT_DIR/$current_hash" ]; then
@@ -125,6 +126,18 @@ build_ref() {
;;
esac
+ # If there is a tag for this commit then we append that to the produced artifacts
+ # A version suffix should only be created if there is a tag for this commit and it is not a release build
+ if [[ -n "$tag" ]]; then
+ # Remove disallowed version characters from the tag
+ version_suffix="+${tag//[^0-9a-z_-]/}"
+ # Will only match paths that include *-dev-* which means release builds will not be included
+ # Pipes all matching names and their new name to mv
+ pushd dist
+ ls | sed -nE "s/^(MullvadVPN-.*-dev-.*)(_amd64\.deb|_x86_64\.rpm|\.exe|\.pkg|\.apk|\.aab)$/\1\2 \1$version_suffix\2/p" | xargs -L 1 mv
+ popd
+ fi
+
(cd dist/ && upload) || return 0
case "$(uname -s)" in
MINGW*|MSYS_NT*)
@@ -145,7 +158,7 @@ while true; do
tags=( $(git tag) )
for tag in "${tags[@]}"; do
- build_ref "refs/tags/$tag"
+ build_ref "refs/tags/$tag" "$tag"
done
for branch in "${BRANCHES_TO_BUILD[@]}"; do