-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (44 loc) · 1.19 KB
/
ci.yml
File metadata and controls
51 lines (44 loc) · 1.19 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
45
46
47
48
49
50
51
name: ci
on:
push:
branches: [master]
tags:
- "v1*"
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: "2.x"
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install dependencies
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bundle exec rspec
- name: Test with rspec
run: |
bundle exec rspec
- name: Build
run: |
gem build passbase.gemspec
- name: Publish
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
env:
GEM_API_KEY: ${{ secrets.GEM_API_KEY }}
run: |
mkdir -p ~/.gem
echo '---' >> ~/.gem/credentials
echo ":rubygems_api_key: $GEM_API_KEY" >> ~/.gem/credentials
chmod 0600 ~/.gem/credentials
gem push ./*.gem
rm ~/.gem/credentials