mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-08-16 03:50:43 +09:00
Port over automatic note generation
This commit is contained in:
+17
-10
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user