-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (51 loc) · 1.56 KB
/
Copy pathgem.yml
File metadata and controls
55 lines (51 loc) · 1.56 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
52
53
54
55
name: "Build, test and release"
on:
- push
- pull_request
jobs:
build:
name: Build + Publish
runs-on: ubuntu-latest
services:
mock-api:
image: firstclasspostcodes/mock:latest
env:
PORT: 3000
ports:
- '3000:3000'
steps:
- uses: actions/checkout@master
- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
version: 2.6.x
- run: gem install bundler
- run: bundle install --jobs 4 --retry 3
- name: Rake
run: bundle exec rake
env:
API_URL: http://localhost:3000
API_KEY: '111111111111'
- name: Publish to GPR
if: github.ref == 'refs/heads/master'
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:github: Bearer ${GITHUB_TOKEN}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
env:
OWNER: firstclasspostcodes
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Publish to RubyGems
if: github.ref == 'refs/heads/master'
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_AUTH_TOKEN}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push *.gem
env:
RUBYGEMS_AUTH_TOKEN: ${{secrets.RUBYGEMS_AUTH_TOKEN}}