diff options
| author | Oskar <oskar@mullvad.net> | 2025-02-04 17:40:18 +0100 |
|---|---|---|
| committer | Oskar <oskar@mullvad.net> | 2025-02-05 15:55:09 +0100 |
| commit | 6a05c388a0b91e297c1521501546dfaf9b22236a (patch) | |
| tree | 1e195736e6ebb7e5fb0c7e2cd0de9128e40637a4 /desktop/scripts | |
| parent | c644d5f2d5e6a8c7840b58af90a1dc6405f4709d (diff) | |
| download | mullvadvpn-6a05c388a0b91e297c1521501546dfaf9b22236a.tar.xz mullvadvpn-6a05c388a0b91e297c1521501546dfaf9b22236a.zip | |
Read product version from file in release scripts
Diffstat (limited to 'desktop/scripts')
| -rwxr-xr-x | desktop/scripts/release/make-release | 10 | ||||
| -rwxr-xr-x | desktop/scripts/release/prepare-release | 49 | ||||
| -rwxr-xr-x | desktop/scripts/release/push-release-tag | 23 | ||||
| -rwxr-xr-x | desktop/scripts/release/test-release-artifacts | 10 |
4 files changed, 46 insertions, 46 deletions
diff --git a/desktop/scripts/release/make-release b/desktop/scripts/release/make-release index eb1946f2d8..cd4897d837 100755 --- a/desktop/scripts/release/make-release +++ b/desktop/scripts/release/make-release @@ -5,14 +5,12 @@ set -eu SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd "$SCRIPT_DIR" -../../../scripts/utils/gh-ready-check +REPO_ROOT=../../../ +PRODUCT_VERSION_PATH=$REPO_ROOT/dist-assets/desktop-product-version.txt +PRODUCT_VERSION=$(cat $PRODUCT_VERSION_PATH) -if [[ $# != 1 ]]; then - echo "!!! Please pass the app version as the first and only argument" - exit 1 -fi +$REPO_ROOT/scripts/utils/gh-ready-check -PRODUCT_VERSION=$1 REPO_URL="git@github.com:mullvad/mullvadvpn-app" ARTIFACT_DIR=$(mktemp -d) REPO_DIR=$(mktemp -d) diff --git a/desktop/scripts/release/prepare-release b/desktop/scripts/release/prepare-release index a8f6f5e1d3..7881597f88 100755 --- a/desktop/scripts/release/prepare-release +++ b/desktop/scripts/release/prepare-release @@ -11,12 +11,11 @@ cd "$SCRIPT_DIR" REPO_ROOT=../../../ source $REPO_ROOT/scripts/utils/log +source $REPO_ROOT/scripts/utils/print-and-run -PUSH_TAG="false" for argument in "$@"; do case "$argument" in - --push-tag) PUSH_TAG="true" ;; -*) log_error "Unknown option \"$argument\"" exit 1 @@ -31,11 +30,6 @@ changes_path=$REPO_ROOT/desktop/packages/mullvad-vpn/changes.txt changelog_path=$REPO_ROOT/CHANGELOG.md product_version_path=$REPO_ROOT/dist-assets/desktop-product-version.txt -function print_and_run { - echo "+ $*" - "$@" -} - function checks { if [[ -z ${PRODUCT_VERSION+x} ]]; then log_error "Please give the release version as an argument to this script." @@ -107,31 +101,18 @@ function update_product_version { $product_version_path } -function push_tag { - product_version=$(echo -n "$(cat $product_version_path)") - echo "Tagging current git commit with release tag $product_version..." - print_and_run git tag -s "$product_version" -m "$product_version" - print_and_run git push origin "$product_version" - log_success "\nTag pushed!" -} - -if [[ $PUSH_TAG == "true" ]]; then - check_commit_signature - push_tag -else - checks - check_commit_signature - check_changelog - update_changelog - update_copyright_year - update_product_version +checks +check_commit_signature +check_changelog +update_changelog +update_copyright_year +update_product_version - log_success "\n=================================================" - log_success "| DONE preparing for a release! |" - log_success "| Now verify that everything looks correct |" - log_success "| and then create and push the tag by |" - log_success "| running: |" - log_success "| $ $0 \\ " - log_success "| --push-tag |" - log_success "=================================================" -fi +log_success "\n=================================================" +log_success "| DONE preparing for a release! |" +log_success "| Now verify that everything looks correct |" +log_success "| and then create and push the tag by |" +log_success "| running: |" +log_success "| $ $0 \\ " +log_success "| --push-tag |" +log_success "=================================================" diff --git a/desktop/scripts/release/push-release-tag b/desktop/scripts/release/push-release-tag new file mode 100755 index 0000000000..6a19cf4fbf --- /dev/null +++ b/desktop/scripts/release/push-release-tag @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +set -eu + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd "$SCRIPT_DIR" + +REPO_ROOT=../../../ +PRODUCT_VERSION_PATH=$REPO_ROOT/dist-assets/desktop-product-version.txt +PRODUCT_VERSION=$(cat $PRODUCT_VERSION_PATH) + +source $REPO_ROOT/scripts/utils/print-and-run + +function push_tag { + product_version=$(echo -n "$PRODUCT_VERSION") + echo "Tagging current git commit with release tag $product_version..." + print_and_run git tag -s "$product_version" -m "$product_version" + print_and_run git push origin "$product_version" + log_success "\nTag pushed!" +} + +git verify-commit HEAD +push_tag diff --git a/desktop/scripts/release/test-release-artifacts b/desktop/scripts/release/test-release-artifacts index 9f5be4ccb1..ff1c5cd3cd 100755 --- a/desktop/scripts/release/test-release-artifacts +++ b/desktop/scripts/release/test-release-artifacts @@ -5,14 +5,12 @@ set -eu SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd "$SCRIPT_DIR" -../../../scripts/utils/gh-ready-check +REPO_ROOT=../../../ +PRODUCT_VERSION_PATH=$REPO_ROOT/dist-assets/desktop-product-version.txt +PRODUCT_VERSION=$(cat $PRODUCT_VERSION_PATH) -if [[ $# != 1 ]]; then - echo "!!! Please pass the app version as the first and only argument" - exit 1 -fi +$REPO_ROOT/scripts/utils/gh-ready-check -PRODUCT_VERSION=$1 gh workflow run desktop-e2e.yml --ref "$PRODUCT_VERSION" \ -f oses="fedora41 ubuntu2404 windows11 macos15" \ -f tests="test_quantum_resistant_tunnel test_ui_tunnel_settings" |
