-
Notifications
You must be signed in to change notification settings - Fork 6
77 lines (74 loc) · 1.99 KB
/
gem-push.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
name: Publish Gem
on:
push:
tags:
- v**
jobs:
build-ruby:
name: ruby
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up Ruby 2.6
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
- name: Build gem
run: gem build *.gemspec
- name: Run tests
run: |
gem install *.gem
bundle install
rake test:gem
- uses: actions/upload-artifact@v3
with:
name: "ruby-gem"
path: "*.gem"
- name: Publish to RubyGems
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 push *.gem
env:
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}"
build-native:
strategy:
matrix:
platform: ['x86-mingw32', 'x64-mingw-ucrt', 'x64-mingw32', 'x86_64-linux', 'x86_64-darwin', 'arm64-darwin']
name: "${{ matrix.platform }}"
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
container:
image: "ghcr.io/rake-compiler/rake-compiler-dock-image:1.3.0-mri-${{ matrix.platform }}"
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Build native gem
shell: bash
run: |
bundle install
bundle exec rake gem:${{ matrix.platform }}:build
- uses: actions/upload-artifact@v3
with:
name: "${{ matrix.platform }}-gem"
path: pkg/*.gem
- name: Publish to RubyGems
shell: bash
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 push pkg/*.gem
env:
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}"