Skip to content

Commit

Permalink
Create workflow for publishing gem (#2)
Browse files Browse the repository at this point in the history
* Create workflow for publishing gem

* Update Gemfile.lock
  • Loading branch information
Frugghi authored Sep 14, 2020
1 parent e558fee commit 24b051b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 6 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/gem-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish

on:
workflow_dispatch:

jobs:
build_publish:
name: Build and Publish
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Build gem
run: gem build *.gemspec
- name: Publish to GitHub Package Registry
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:github: Bearer ${GITHUB_TOKEN}\n" > $HOME/.gem/credentials
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
OWNER: microsoft
- name: Publish to RubyGems
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem push *.gem
env:
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ PATH
remote: .
specs:
cocoapods-azure-universal-packages (0.0.1)
addressable (>= 2.6.0)
cocoapods
cocoapods-downloader
addressable (~> 2.6)
cocoapods (~> 1.0)
cocoapods-downloader (~> 1.0)

GEM
remote: https://rubygems.org/
Expand Down
6 changes: 3 additions & 3 deletions cocoapods-azure-universal-packages.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']

spec.add_runtime_dependency 'cocoapods'
spec.add_runtime_dependency 'cocoapods-downloader'
spec.add_runtime_dependency 'addressable', '>= 2.6.0'
spec.add_runtime_dependency 'cocoapods', '~> 1.0'
spec.add_runtime_dependency 'cocoapods-downloader', '~> 1.0'
spec.add_runtime_dependency 'addressable', '~> 2.6'

spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rspec', '~> 3.9'
Expand Down

0 comments on commit 24b051b

Please sign in to comment.