Skip to content
This repository was archived by the owner on Feb 28, 2019. It is now read-only.

Commit 4989c74

Browse files
committed
Update to the latest version of mcrt
1 parent 6ba93e1 commit 4989c74

File tree

3 files changed

+3
-53
lines changed

3 files changed

+3
-53
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ install:
1414
- rvm use 2.3.1
1515
- gem install bundler
1616
- bundle install
17-
script: buildr package publish_if_tagged
17+
script: buildr package mcrt:publish_if_tagged
1818
git:
1919
depth: false
2020
env:

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ source 'https://rubygems.org'
22

33
gem 'buildr', '= 1.5.5'
44
gem 'zapwhite', '= 2.8.0'
5-
gem 'mcrt', '= 1.4.0'
5+
gem 'mcrt', '= 1.6.0'
66
gem 'octokit', '~> 4.0'
77
gem 'netrc', '~> 0.11'

tasks/publish.rake

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,3 @@
11
require 'mcrt'
22

3-
desc 'Publish release on maven central'
4-
task 'publish_to_maven_central' do
5-
project = Buildr.projects[0].root_project
6-
password = ENV['MAVEN_CENTRAL_PASSWORD'] || (raise "Unable to locate environment variable with name 'MAVEN_CENTRAL_PASSWORD'")
7-
MavenCentralPublishTool.buildr_release(project, 'org.realityforge', 'realityforge', password)
8-
end
9-
10-
def get_head_tag_if_any
11-
version = `git describe --exact-match --tags 2>&1`
12-
if 0 == $?.exitstatus && version =~ /^v[0-9]/ && (ENV['TRAVIS_BUILD_ID'].nil? || ENV['TRAVIS_TAG'].to_s != '')
13-
version.strip
14-
else
15-
nil
16-
end
17-
end
18-
19-
def is_tag_on_branch?(tag, branch)
20-
output = `git tag --merged #{branch} 2>&1`
21-
tags = output.split
22-
tags.include?(tag)
23-
end
24-
25-
def is_tag_on_candidate_branches?(tag, branches)
26-
sh 'git fetch origin'
27-
branches.each do |branch|
28-
if is_tag_on_branch?(tag, branch)
29-
puts "Tag #{tag} is on branch: #{branch}"
30-
return true
31-
elsif is_tag_on_branch?(tag, "origin/#{branch}")
32-
puts "Tag #{tag} is on branch: origin/#{branch}"
33-
return true
34-
else
35-
puts "Tag #{tag} is not on branches: #{branch} or origin/#{branch}"
36-
end
37-
end
38-
false
39-
end
40-
41-
desc 'Publish release to maven central iff current HEAD is a tag'
42-
task 'publish_if_tagged' do
43-
candidate_branches = %w(master)
44-
tag = get_head_tag_if_any
45-
if tag.nil?
46-
puts 'Current HEAD is not a tag. Skipping publish step.'
47-
else
48-
puts "Current HEAD is a tag: #{tag}"
49-
if is_tag_on_candidate_branches?(tag, candidate_branches)
50-
task('publish_to_maven_central').invoke
51-
end
52-
end
53-
end
3+
MavenCentralReleaseTool.define_publish_tasks(:profile_name => 'org.realityforge', :username => 'realityforge')

0 commit comments

Comments
 (0)