Skip to content

Commit

Permalink
Add Github action to publish the gem (#307)
Browse files Browse the repository at this point in the history
* Add Github action to publish the gem

* Only publish on tags

* Publish gems using direct commands, not third party action

* Use rake build + gem push

* Don't need github token
  • Loading branch information
treydock authored Jul 29, 2021
1 parent c015410 commit 5f26816
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish Gem

on:
push:
tags:
- "*"

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Set version
id: version
run: echo ::set-output name=version::${GITHUB_REF#refs/*/v}

- name: checkout
uses: actions/checkout@v2

- name: Setup Ruby using Bundler
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7.1"
bundler-cache: true
bundler: "2.1.4"

- name: install gems
run: bundle install

- name: Setup Rubygems credentials
run: |
set +x
mkdir -p ~/.gem
cat << EOF > ~/.gem/credentials
---
:rubygems_api_key: ${{secrets.OSC_RUBYGEMS_API_KEY}}
EOF
chmod 0600 ~/.gem/credentials
- name: Publish Gem
run: |
rake build
gem push pkg/ood_core-${{ steps.version.outputs.version }}.gem

0 comments on commit 5f26816

Please sign in to comment.