summaryrefslogtreecommitdiffhomepage
path: root/desktop/scripts
diff options
context:
space:
mode:
authorOskar <oskar@mullvad.net>2025-01-31 14:39:39 +0100
committerOskar <oskar@mullvad.net>2025-02-04 13:06:23 +0100
commit9df584e24b0f362ef92d806a88d73819daee89b0 (patch)
tree991a29dbeb2e768e2031dea9f800b2968c56c806 /desktop/scripts
parentb8c5786966e5d1a01250b9df22b7038710ad471f (diff)
downloadmullvadvpn-9df584e24b0f362ef92d806a88d73819daee89b0.tar.xz
mullvadvpn-9df584e24b0f362ef92d806a88d73819daee89b0.zip
Separate preparation and pushing tag
Diffstat (limited to 'desktop/scripts')
-rwxr-xr-xdesktop/scripts/prepare-release.sh53
1 files changed, 34 insertions, 19 deletions
diff --git a/desktop/scripts/prepare-release.sh b/desktop/scripts/prepare-release.sh
index de4390e15f..3ea8788c8f 100755
--- a/desktop/scripts/prepare-release.sh
+++ b/desktop/scripts/prepare-release.sh
@@ -12,8 +12,11 @@ REPO_ROOT=../../
source $REPO_ROOT/scripts/utils/log
+PUSH_TAG="false"
+
for argument in "$@"; do
case "$argument" in
+ --push-tag) PUSH_TAG="true" ;;
-*)
log_error "Unknown option \"$argument\""
exit 1
@@ -45,17 +48,19 @@ function checks {
exit 1
fi
+ if [[ $(grep "CHANGE THIS BEFORE A RELEASE" $changes_path) != "" ]]; then
+ log_error "It looks like you did not update $changes_path"
+ exit 1
+ fi
+}
+
+function check_commit_signature {
if ! git verify-commit HEAD; then
log_error \
"Current commit lacks valid signature. Releases can only be made from signed commits."
exit 1
fi
echo ""
-
- if [[ $(grep "CHANGE THIS BEFORE A RELEASE" $changes_path) != "" ]]; then
- log_error "It looks like you did not update $changes_path"
- exit 1
- fi
}
function check_changelog {
@@ -97,20 +102,30 @@ function update_product_version {
$product_version_path
}
-function create_tag {
- echo "Tagging current git commit with release tag $PRODUCT_VERSION..."
- print_and_run git tag -s "$PRODUCT_VERSION" -m "$PRODUCT_VERSION"
+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!"
}
-checks
-check_changelog
-update_changelog
-update_product_version
-create_tag
+if [[ $PUSH_TAG == "true" ]]; then
+ check_commit_signature
+ push_tag
+else
+ checks
+ check_commit_signature
+ check_changelog
+ update_changelog
+ update_product_version
-log_success "================================================="
-log_success "| DONE preparing for a release! |"
-log_success "| Now push the tag created by this script |"
-log_success "| after you have verified it is correct: |"
-log_success "| $ git push origin $PRODUCT_VERSION"
-log_success "================================================="
+ 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