Release 0.14.0 (#300)
* Introduce script to automate release * Rakefile levelup * Version 0.14.0 * Fix newline at end of podspec.json * Ensure we start and end on master branch And that we pull latest master before tagging * CRLF at EOF * Remove [:version] param from `release:finish` task It can be guessed from the current podspec version * Fix create_release task * Ensure we run rake via bundle exec Co-authored-by: David Jennes <djbe@users.noreply.github.com> Co-authored-by: David Jennes <djbe@users.noreply.github.com>
This commit is contained in:
34
rakelib/changelog.rake
Normal file
34
rakelib/changelog.rake
Normal file
@@ -0,0 +1,34 @@
|
||||
NEW_CHANGELOG_SECTION = "## Master\n" + ['Breaking', 'Enhancements', 'Deprecations', 'Bug Fixes', 'Internal Changes'].map do |s|
|
||||
<<~MARKDOWN
|
||||
|
||||
### #{s}
|
||||
|
||||
_None_
|
||||
MARKDOWN
|
||||
end.join
|
||||
|
||||
def changelog_first_section
|
||||
content = []
|
||||
section_count = 0
|
||||
File.foreach(CHANGELOG_FILE) do |line|
|
||||
section_count += 1 if line.start_with?('## ')
|
||||
break if section_count > 1
|
||||
content.append(line) if section_count == 1
|
||||
end
|
||||
content[1..].join
|
||||
end
|
||||
|
||||
namespace :changelog do
|
||||
# rake changelog:reset
|
||||
desc "Add a new empty section at the top of the changelog and git push it"
|
||||
task :reset do
|
||||
header "Reset CHANGELOG"
|
||||
content = File.read(CHANGELOG_FILE)
|
||||
new_content = NEW_CHANGELOG_SECTION + "\n" + content
|
||||
File.write(CHANGELOG_FILE, new_content)
|
||||
|
||||
sh("git", "add", CHANGELOG_FILE)
|
||||
sh("git", "commit", "-m", "Reset CHANGELOG")
|
||||
sh("git", "push")
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user