diff options
| author | Jonathan <jonathan@mullvad.net> | 2022-05-11 16:57:56 +0200 |
|---|---|---|
| committer | Jonathan <jonathan@mullvad.net> | 2022-05-16 09:06:46 +0200 |
| commit | fe7eaa33bf1c53bf03f2824d047832d4dc8d32a2 (patch) | |
| tree | bc4bdf85db23690b1d8ec7ee9868d12d0b879316 /ci | |
| parent | afe5de400321969c6e0af345cc1f38dab18ce0a0 (diff) | |
| download | mullvadvpn-fe7eaa33bf1c53bf03f2824d047832d4dc8d32a2.tar.xz mullvadvpn-fe7eaa33bf1c53bf03f2824d047832d4dc8d32a2.zip | |
Add the artifact tagging code to the buildserver
Move the appropriate artifact tagging code to the buildserver script.
Previously the tag was right before the `.deb` and `.rpm` which causes
issues for the uploading on the buildserver. This makes sure that the
tag information is put before the `_amd64` and `_x86_64`
Diffstat (limited to 'ci')
| -rwxr-xr-x | ci/buildserver-build.sh | 15 |
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 |
