Add workflow to automatically create a release

This commit is contained in:
Benoit Daloze
2024-06-27 15:23:12 +02:00
parent 21a479f2d7
commit 3251c5c21b
3 changed files with 39 additions and 7 deletions
+17
View File
@@ -0,0 +1,17 @@
require 'json'
def run(command_line)
puts "$ #{command_line}"
output = `#{command_line}`
puts output
raise $?.inspect unless $?.success?
output
end
latest_release_tag = run 'gh release view --json tagName'
latest_release_tag = JSON.load(latest_release_tag).fetch('tagName')
raise latest_release_tag unless latest_release_tag =~ /\Av(\d+).(\d+).(\d+)\z/
tag = "v#{$1}.#{Integer($2)+1}.0"
run "gh release create --generate-notes --latest #{tag}"