-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (35 loc) · 973 Bytes
/
gempush.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: Ruby Gem
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
name: Build + Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- name: Install necessary gems
run: |
gem install rotp -v 5.1.0 --no-document
- name: prepare credentials
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
env:
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
- name: build gem
run: |
gem build *.gemspec
- name: publish
run: |
gem push *.gem --otp $(rotp --secret ${GEM_HOST_OTP_SECRET})
env:
GEM_HOST_OTP_SECRET: ${{secrets.RUBYGEMS_OTP_SECRET}}