summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJonathan <jonathan@mullvad.net>2022-05-16 11:13:49 +0200
committerJonathan <jonathan@mullvad.net>2022-05-16 11:13:49 +0200
commit178cec7e6133790f827e160e1823adf27215abee (patch)
treebc4bdf85db23690b1d8ec7ee9868d12d0b879316
parent1180c82426d1bae0c154af48702741501080652a (diff)
parentfe7eaa33bf1c53bf03f2824d047832d4dc8d32a2 (diff)
downloadmullvadvpn-178cec7e6133790f827e160e1823adf27215abee.tar.xz
mullvadvpn-178cec7e6133790f827e160e1823adf27215abee.zip
Merge branch 'tag-artifact-names-only-when-developing'
-rwxr-xr-xbuild.sh10
-rwxr-xr-xci/buildserver-build.sh15
2 files changed, 15 insertions, 10 deletions
diff --git a/build.sh b/build.sh
index a12d53157f..e0b4ad56cd 100755
--- a/build.sh
+++ b/build.sh
@@ -379,16 +379,8 @@ esac
popd
SEMVER_VERSION=$(echo "$PRODUCT_VERSION" | sed -Ee 's/($|-.*)/.0\1/g')
-current_head_commit_tag=$(git tag --points-at HEAD)
for semver_path in dist/*"$SEMVER_VERSION"*; do
- # If there is a tag for this commit then we append that to the produced artifacts
- # We don't want to change the actual PRODUCT_VERSION as metadata in the form of +<metadata> is ignored by electron builder etc
- version_suffix=""
- if [[ -n "$current_head_commit_tag" ]]; then
- # Remove disallowed version characters from the tag
- version_suffix="+${current_head_commit_tag//[^0-9a-z_-]/}"
- fi
- product_path=$(echo "$semver_path" | sed -Ee "s/$SEMVER_VERSION/$PRODUCT_VERSION$version_suffix/g")
+ product_path=$(echo "$semver_path" | sed -Ee "s/$SEMVER_VERSION/$PRODUCT_VERSION/g")
log_info "Moving $semver_path -> $product_path"
mv "$semver_path" "$product_path"
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