-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (39 loc) · 1.37 KB
/
release-github.yml
File metadata and controls
44 lines (39 loc) · 1.37 KB
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
43
44
name: Build & Release Gem to Github Packages
on:
workflow_call:
inputs:
debug:
description: "Enable SSH debugging"
required: false
default: false
type: boolean
jobs:
release_to_github_packages:
# 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:github: Bearer ${GITHUB_TOKEN}\n" > $HOME/.gem/credentials
cat $HOME/.gem/credentials
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Publish to GitHub Packages
run: |
export OWNER=$( echo ${{ github.repository }} | cut -d "/" -f 1 )
gem build *.gemspec
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
gem push *.gem