Skip to content

Commit

Permalink
[Fixes rubocop#67] Update cut_release for antora
Browse files Browse the repository at this point in the history
  • Loading branch information
marcandre committed Jul 19, 2020
1 parent 27e1d49 commit 1cbed61
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tasks/cut_release.rake
Expand Up @@ -11,11 +11,21 @@ namespace :cut_release do
end
end

def version_sans_patch(version)
version.split('.').take(2).join('.')
end

def update_file(path)
content = File.read(path)
File.write(path, yield(content))
end

def update_antora(version)
update_file('docs/antora.yml') do |yaml|
yaml.gsub(/version: .*/, "version: '#{version}'")
end
end

def add_header_to_changelog(version)
update_file('CHANGELOG.md') do |changelog|
head, tail = changelog.split("## master (unreleased)\n\n", 2)
Expand All @@ -34,6 +44,7 @@ namespace :cut_release do
new_version = Bump::Bump.current

add_header_to_changelog(new_version)
update_antora(new_version)

puts "Changed version from #{old_version} to #{new_version}."
end
Expand Down

0 comments on commit 1cbed61

Please sign in to comment.