diff options
| author | Oskar <oskar@mullvad.net> | 2025-10-28 09:51:10 +0100 |
|---|---|---|
| committer | Oskar <oskar@mullvad.net> | 2025-10-28 09:51:10 +0100 |
| commit | 7b9330fa0d76701e9bc6e58f21b9b1b58233cc6a (patch) | |
| tree | e13edef81caf56a8f73de6775c26d834d3ddea2a /desktop/scripts | |
| parent | 9e3e825e8c20870457410fd1a9568a4899ad93d8 (diff) | |
| parent | 54ba172121c2e1e45075d902321605ee40610baf (diff) | |
| download | mullvadvpn-7b9330fa0d76701e9bc6e58f21b9b1b58233cc6a.tar.xz mullvadvpn-7b9330fa0d76701e9bc6e58f21b9b1b58233cc6a.zip | |
Merge branch 'edit-github-release-as-part-of-release-script'
Diffstat (limited to 'desktop/scripts')
| -rwxr-xr-x | desktop/scripts/release/4-make-release | 43 |
1 files changed, 38 insertions, 5 deletions
diff --git a/desktop/scripts/release/4-make-release b/desktop/scripts/release/4-make-release index 9766223ec0..2cb9279586 100755 --- a/desktop/scripts/release/4-make-release +++ b/desktop/scripts/release/4-make-release @@ -1,13 +1,29 @@ #!/usr/bin/env bash # This script downloads the build artifacts along with the signatures, verifies the signatures and -# creates a GitHub draft release. This should be run after `3-verify-build`. +# creates a GitHub release. This should be run after `3-verify-build`. To create a draft release, +# add the --draft flag. set -eu SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd "$SCRIPT_DIR" +function usage { + echo "Usage: $0 [--draft] [-h|--help]" + echo " --draft Creates the GitHub release as a draft" + exit 0 +} + +DRAFT="false" +while [[ "$#" -gt 0 ]]; do + case $1 in + --draft) DRAFT="true";; + -h|--help) usage ;; + esac + shift +done + REPO_ROOT=../../../ PRODUCT_VERSION_PATH=$REPO_ROOT/dist-assets/desktop-product-version.txt PRODUCT_VERSION=$(cat $PRODUCT_VERSION_PATH) @@ -37,13 +53,16 @@ function publish_release { awk 'NF { last = last ? last ORS $0 : $0 } END { print last }') release_flags=( - --draft --repo "git@github.com:mullvad/mullvadvpn-app" --verify-tag --notes-file - --title "$PRODUCT_VERSION" ) + if [[ "$DRAFT" == "true" ]]; then + release_flags+=(--draft) + fi + previous_release=$(echo "$changelog_extract" | tail -1 | grep -oP '## \[\K[^\]]+') body="This release is for desktop only." @@ -62,12 +81,26 @@ function publish_release { body+="\n$changelog" + read -rp "The suggested changelog will be opened in an editor, please finalize and save it before exiting. Press enter to open changelog..." + + tmp_changelog_file=$(mktemp) + { + printf "%b" "$body" + printf "%b" "\n\n<!--\nThe following artifacts will be included:\n" + # shellcheck disable=SC2012 + ls -lh "$ARTIFACT_DIR" | tail -n +2 | awk '{print $9,"( Size:",$5,")"}' + echo "-->" + } > "$tmp_changelog_file" + + "${EDITOR:-"vim"}" "$tmp_changelog_file" + log_header "Creating GitHub release" - # shellcheck disable=SC2059 # shellcheck disable=SC2046 - printf "$body" | gh release create "${release_flags[@]}" "$PRODUCT_VERSION" $(printf "%s " "$ARTIFACT_DIR"/*) + gh release create "${release_flags[@]}" "$PRODUCT_VERSION" $(printf "%s " "$ARTIFACT_DIR"/*) < "$tmp_changelog_file" - log_success "\nThe above URL contains the text \"untagged\", but don't worry it is tagged properly and everything will look correct once it's published." + if [[ "$DRAFT" == "true" ]]; then + log_success "\nThe above URL contains the text \"untagged\", but don't worry it is tagged properly and everything will look correct once it's published." + fi } ./download-release-artifacts "$PRODUCT_VERSION" "$ARTIFACT_DIR" |
