-
Notifications
You must be signed in to change notification settings - Fork 6
80 lines (74 loc) · 2.48 KB
/
release.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Publish Gem
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "12.x"
- name: Find yarn cache location
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: JS package cache
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install packages
run: |
yarn install --pure-lockfile
- name: Set up Ruby 3.0.0
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.0
- name: Ruby gem cache
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install postgres headers
run: sudo apt-get -yqq install libpq-dev
- name: Bundle Setup
run: |
gem update --system 3.1.4 -N
gem install --no-document bundler
bundle config path ${{ github.workspace }}/vendor/bundle
working-directory: ./lib/nexmo_developer
- name: Bundle Install
env:
POSTGRES_USERNAME: postgres
run: |
bundle install --jobs 4 --retry 3
working-directory: ./lib/nexmo_developer
- name: Precompile assets
env:
RAILS_SERVE_STATIC_FILES: 1
DISABLE_SSL: 1
RAILS_LOG_TO_STDOUT: 1
RAILS_ENV: production
run: bundle exec rails assets:precompile
working-directory: ./lib/nexmo_developer
- name: Set Credentials
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:github: Bearer ${GITHUB_TOKEN}\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
- name: Publish to GitHub Packages
run: |
export OWNER=$( echo ${{ github.repository }} | cut -d "/" -f 1 )
gem build station.gemspec
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
gem push *.gem