Created
November 30, 2017 22:33
-
-
Save dhollinger/725fda6bfb1fc194c0962b4008d160a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc 'Release new module' | |
task 'module_release' do | |
tag_pattern = "%s" | |
Blacksmith::RakeTask.new do |t| | |
t.tag_pattern = tag_pattern | |
t.build = false # do not build the module nor push it to the Forge | |
# just do the tagging [:clean, :tag, :bump_commit] | |
end | |
m = Blacksmith::Modulefile.new | |
v = m.version | |
raise "Refusing to release an RC or build-release (#{v}).\n" + | |
"Please set a semver *release* version." unless v =~ /^\d+\.\d+.\d+$/ | |
# do a "manual" module:release (clean, tag, bump, commit, push tags) | |
Rake::Task['module:clean'].invoke | |
# idempotently create tags | |
g = Blacksmith::Git.new | |
g.tag_pattern = tag_pattern | |
Rake::Task['module:tag'].invoke unless g.has_version_tag?(v) | |
system(`git push origin --tags`) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment