Skip to content

Commit

Permalink
Adds Script to Publish to Github Package Registry/Rubygems.org (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyledecot authored Oct 19, 2019
1 parent ef9a1a9 commit 431b0d2
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
/spec/reports/
/tmp/

# rspec failure tracking
.rspec_status
.DS_Store
*.gem
38 changes: 38 additions & 0 deletions bin/publish
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

0 comments on commit 431b0d2

Please sign in to comment.