Skip to content

Commit

Permalink
add automation for publishing this gem (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
johrstrom committed Feb 24, 2023
1 parent 74fece8 commit 5bfdaf1
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 "version=${GITHUB_REF#refs/*/v}" >> $GITHUB_OUTPUT

- name: checkout
uses: actions/checkout@v3

- 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_ROBOT_RUBYGEMS_TOKEN }}
EOF
chmod 0600 ~/.gem/credentials
- name: Publish Gem
run: |
bundle exec rake build
gem push pkg/ood_support-${{ steps.version.outputs.version }}.gem

0 comments on commit 5bfdaf1

Please sign in to comment.