-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (51 loc) · 1.3 KB
/
ruby.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: CI Matrix Testing
on:
push:
branches: [ master ]
tags:
- "*"
pull_request:
branches: [ master ]
jobs:
rspec:
runs-on: ubuntu-latest
strategy:
matrix:
ruby_version: [2.5, 2.6, 2.7]
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
- name: Install sqlite3
run: |
sudo apt-get install libsqlite3-dev
- name: Install dependencies
run: |
gem install bundler -v 2.1.4 --no-document
bundle install --jobs 4 --retry 3
- name: Build and test with Rake
run: |
bundle exec rspec
build:
needs: rspec
name: Publish Gem
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.7.x
- name: Publish to RubyGems
if: contains(github.ref, 'refs/tags/')
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
gem build *.gemspec
gem push *.gem
env:
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}