-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (37 loc) · 1.22 KB
/
release-rubygems.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Build & Release Gem to RubyGems
on:
workflow_call:
inputs:
debug:
description: "Enable SSH debugging"
required: false
default: false
type: boolean
jobs:
release_to_rubygems:
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- if: ${{ inputs.debug }}
name: Setup SSH session
uses: lhotari/action-upterm@v1
with:
## limits ssh access and adds the ssh public keys of the listed GitHub users
limit-access-to-users: ncphillips,chrisdmacrae
- name: Set Credentials
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: Bearer ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
cat $HOME/.gem/credentials
env:
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
- name: Publish to RubyGems
run: |
gem build *.gemspec
gem push *.gem