-
Notifications
You must be signed in to change notification settings - Fork 5
68 lines (61 loc) · 1.63 KB
/
gem.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
name: Build and release gem
on:
workflow_dispatch:
push:
branches:
- main
tags:
- 'v*'
jobs:
native_gem:
name: Compile native gem
runs-on: ubuntu-latest
strategy:
matrix:
platform:
- "aarch64-linux"
- "arm64-darwin"
- "x86_64-darwin"
- "x86_64-linux"
- "x86_64-linux-musl"
- "x64-mingw32"
- "x64-mingw-ucrt"
environment: "yrb-deploy"
steps:
- uses: actions/checkout@v2
- uses: oxidize-rb/actions/setup-ruby-and-rust@main
with:
rubygems: latest
ruby-version: "3.2"
bundler-cache: false
cargo-cache: true
cargo-vendor: true
- uses: oxidize-rb/cross-gem-action@main
with:
platform: ${{ matrix.platform }}
version: 'latest'
env: |
RUBY_CC_VERSION=3.2.0:3.1.0:3.0.0
- uses: actions/download-artifact@v3
with:
name: cross-gem
path: pkg/
- name: Display structure of built gems
run: ls -R
working-directory: pkg/
- name: Release gem
if: startsWith(github.ref, 'refs/tags/v')
working-directory: pkg/
env:
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials
for i in *.gem; do
if [ -f "$i" ]
then
gem push "$i" || true
fi
done