From 2aa4141077141335e79cb0eac5a0eec1a57b2772 Mon Sep 17 00:00:00 2001 From: "Stanko K.R." Date: Tue, 4 Aug 2026 17:13:07 +0200 Subject: [PATCH] Port over automatic note generation --- bin/release | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/bin/release b/bin/release index de4afcb..5c3cdd3 100755 --- a/bin/release +++ b/bin/release @@ -15,6 +15,7 @@ include SSHKit::DSL ARCH = "linux/amd64,linux/arm64" BUILDER_NAME = "campfire-builder" GIT_SHA = `git rev-parse HEAD`.strip +MANUAL_NOTES = ARGV.delete("--notes") VERSION = ARGV[0] DOCKER_IMAGE_NAME = "registry.once.com/campfire" @@ -28,7 +29,7 @@ EXPORT_REMOTE_USER = "app" EXPORT_DEPLOY_HOSTS = %w[ once-store-app-101 once-store-app-102 ] EXPORT_DEPLOY_LOCATION = "/local/app/product_releases/" -abort "You must specify a version, e.g. `bin/release 1.0.0`" unless VERSION +abort "You must specify a version, e.g. `bin/release 1.0.0` (pass --notes to write release notes manually)" unless VERSION current_branch = `git rev-parse --abbrev-ref HEAD`.strip if current_branch != "main" @@ -57,19 +58,25 @@ on(:local) do end announcing "Creating GitHub release v#{VERSION}..." do - notes_file = "tmp/release_notes.md" - on(:local) do - execute :mkdir, "-p", "tmp" + if MANUAL_NOTES + notes_file = "tmp/release_notes.md" - File.write(notes_file, "# What's Changed\n\n- \n") - system ENV["EDITOR"] || "vim", notes_file + execute :mkdir, "-p", "tmp" - unless system "gh", "release", "create", "v#{VERSION}", "--title", "v#{VERSION}", "--notes-file", notes_file - abort "Failed to create release; check that the version doesn't already exist" + File.write(notes_file, "# What's Changed\n\n- \n") + system ENV["EDITOR"] || "vim", notes_file + + unless system "gh", "release", "create", "v#{VERSION}", "--title", "v#{VERSION}", "--notes-file", notes_file + abort "Failed to create release; check that the version doesn't already exist" + end + + execute :rm, notes_file + else + unless system "gh", "release", "create", "v#{VERSION}", "--title", "v#{VERSION}", "--generate-notes" + abort "Failed to create release; check that the version doesn't already exist" + end end - - execute :rm, notes_file end end