-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds Script to Publish to Github Package Registry/Rubygems.org (#81)
- Loading branch information
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,6 @@ | |
/spec/reports/ | ||
/tmp/ | ||
|
||
# rspec failure tracking | ||
.rspec_status | ||
.DS_Store | ||
*.gem |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
require 'optparse' | ||
require 'app_store_connect/version' | ||
|
||
OPTIONS = { | ||
hosts: [], | ||
version: AppStoreConnect::VERSION | ||
}.freeze | ||
|
||
HOSTS = { | ||
rubygems: 'https://rubygems.org', | ||
github: 'https://rubygems.pkg.github.com/kyledecot' | ||
}.freeze | ||
|
||
OptionParser.new do |parser| | ||
HOSTS.keys.each do |key| | ||
parser.on("--#{key}") do | ||
OPTIONS[:hosts] << key | ||
end | ||
end | ||
|
||
parser.on('--version VERSION') do |version| | ||
OPTIONS[:version] = version | ||
end | ||
|
||
parser.on('--help', '-h') do | ||
puts parser | ||
exit(0) | ||
end | ||
end.parse! | ||
|
||
OPTIONS[:hosts].each do |key| | ||
ENV['RUBYGEMS_HOST'] = HOSTS.fetch(key) | ||
|
||
system "gem push -k #{key} app_store_connect-#{OPTIONS[:version]}.gem" | ||
end |