diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2023-02-20 09:55:05 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2023-02-20 09:55:05 +0100 |
| commit | 5af2daf6eac19bc567bac3cc0cecd11ed1760e89 (patch) | |
| tree | b1694571c78c54a426122fbb5c7c8ee7f294ca1e | |
| parent | 5d87248c1c052f6f6f338b60ff3ff284dd617bfd (diff) | |
| parent | fac93766c97b4600701a4cd2810dc611555436a9 (diff) | |
| download | mullvadvpn-5af2daf6eac19bc567bac3cc0cecd11ed1760e89.tar.xz mullvadvpn-5af2daf6eac19bc567bac3cc0cecd11ed1760e89.zip | |
Merge branch 'automatically-build-test-executable'
| -rwxr-xr-x | ci/buildserver-build.sh | 13 | ||||
| -rwxr-xr-x | ci/buildserver-upload.sh | 4 | ||||
| -rw-r--r-- | gui/package.json | 2 | ||||
| -rwxr-xr-x | gui/scripts/build-test-executable.sh | 39 | ||||
| -rw-r--r-- | gui/standalone-tests.pkg.json (renamed from gui/test.pkg.json) | 5 |
5 files changed, 52 insertions, 11 deletions
diff --git a/ci/buildserver-build.sh b/ci/buildserver-build.sh index 0f68577803..406fb2166e 100755 --- a/ci/buildserver-build.sh +++ b/ci/buildserver-build.sh @@ -100,7 +100,7 @@ build_ref() { # Make sure we have the latest Rust and Node toolchains before the build rustup update - version="$(cargo run -q --bin mullvad-version)" + version="$(cargo run -q --bin mullvad-version || return 0)" artifact_dir="dist/$version" mkdir -p "$artifact_dir" @@ -109,7 +109,10 @@ build_ref() { BUILD_ARGS+=(--universal) fi ./build.sh "${BUILD_ARGS[@]}" || return 0 - mv dist/*.{deb,rpm,exe,pkg} "$artifact_dir" + mv dist/*.{deb,rpm,exe,pkg} "$artifact_dir" || return 0 + + (gui/scripts/build-test-executable.sh && mv "dist/app-e2e-tests-$version"* "$artifact_dir") || \ + true case "$(uname -s)" in MINGW*|MSYS_NT*) @@ -123,7 +126,11 @@ build_ref() { Linux*) echo "Building ARM64 installers" TARGETS=aarch64-unknown-linux-gnu ./build.sh "${BUILD_ARGS[@]}" || return 0 - mv dist/*.{deb,rpm} "$artifact_dir" + mv dist/*.{deb,rpm} "$artifact_dir" || return 0 + + (gui/scripts/build-test-executable.sh aarch64-unknown-linux-gnu && \ + mv "dist/app-e2e-tests-$version"* "$artifact_dir") || \ + true ;; esac diff --git a/ci/buildserver-upload.sh b/ci/buildserver-upload.sh index 2bd1a29a8d..3b5e8ad09b 100755 --- a/ci/buildserver-upload.sh +++ b/ci/buildserver-upload.sh @@ -31,13 +31,13 @@ while true; do files=$(awk '{print $2}' < "$checksums_path") for file in $files; do file_upload_dir="$upload_path/$version" - if [[ ! $file =~ \.($BUILD_ARTIFACT_EXTENSIONS|asc)$ ]]; then + if [[ ! $file == MullvadVPN-* ]]; then file_upload_dir="$file_upload_dir/additional-files" fi rsync -av --rsh='ssh -p 1122' "$file" "build@releases.mullvad.net:$file_upload_dir/" || continue - if [[ $file =~ \.($BUILD_ARTIFACT_EXTENSIONS)$ ]]; then + if [[ $file == MullvadVPN-* ]]; then rm -f "$file.asc" gpg -u A1198702FC3E0A09A9AE5B75D5A1D4F266DE8DDF --pinentry-mode loopback --sign --armor --detach-sign "$file" rsync -av --rsh='ssh -p 1122' "$file.asc" "build@releases.mullvad.net:$file_upload_dir/" || continue diff --git a/gui/package.json b/gui/package.json index 6ae0282e0f..967dc1b501 100644 --- a/gui/package.json +++ b/gui/package.json @@ -90,7 +90,7 @@ "postinstall": "cross-env ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=true electron-builder install-app-deps", "build": "gulp build", "build-proto": "gulp build-proto", - "pack-test-executable": "pkg --config test.pkg.json --output ../dist/mullvadvpn-app-e2e-tests build/standalone-tests.js", + "pack-test-executable": "pkg --config standalone-tests.pkg.json --output ../dist/mullvadvpn-app-e2e-tests build/standalone-tests.js", "build-test-executable": "npm run build && npm run pack-test-executable", "lint": "eslint --ext tsx,ts .", "format": "prettier \"**/*.{js,css,ts,tsx}\" --write", diff --git a/gui/scripts/build-test-executable.sh b/gui/scripts/build-test-executable.sh new file mode 100755 index 0000000000..273e1d4920 --- /dev/null +++ b/gui/scripts/build-test-executable.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +set -eu + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd "$SCRIPT_DIR/.." + +TARGET=${1:-$(rustc -vV | sed -n 's|host: ||p')} +PRODUCT_VERSION=$(cargo run -q --bin mullvad-version) + +function build_test_executable { + local pkg_target=$1 + local suffix=${2:-""} + local output="../dist/app-e2e-tests-$PRODUCT_VERSION-$TARGET$suffix" + + npm exec pkg -- \ + --config standalone-tests.pkg.json \ + --targets "$pkg_target" \ + --output "$output" \ + build/standalone-tests.js +} + +case "$TARGET" in + "aarch64-unknown-linux-gnu") + build_test_executable linux-arm64 + ;; + "x86_64-unknown-linux-gnu") + build_test_executable linux-x64 + ;; + "aarch64-apple-darwin") + build_test_executable macos-arm64 + ;; + "x86_64-apple-darwin") + build_test_executable macos-x64 + ;; + "x86_64-pc-windows-msvc") + build_test_executable win-x64 .exe + ;; +esac diff --git a/gui/test.pkg.json b/gui/standalone-tests.pkg.json index 587e05f065..1b91ca8495 100644 --- a/gui/test.pkg.json +++ b/gui/standalone-tests.pkg.json @@ -1,9 +1,4 @@ { - "targets": [ - "linux-x64", - "macos-x64", - "win-x64" - ], "assets": [ "build/src/config.json", "build/test/e2e/utils.js", |
