-
Notifications
You must be signed in to change notification settings - Fork 133
101 lines (91 loc) · 2.43 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: "Release RubyGem"
on:
push:
tags:
- "v*"
branches:
- "release-gem"
jobs:
build:
name: Release cross gems
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-platform:
- arm64-darwin
- x86_64-darwin
- x86_64-linux
- aarch64-linux
- x86_64-linux-musl
- aarch64-linux-musl
steps:
- uses: actions/checkout@v4
- uses: oxidize-rb/actions/[email protected]
with:
ruby-version: "3.3"
bundler-cache: false
cargo-cache: true
cargo-vendor: true
- uses: oxidize-rb/actions/[email protected]
with:
platform: ${{ matrix.ruby-platform }}
ruby-versions: "3.3,3.2,3.1"
- uses: actions/upload-artifact@v4
with:
name: bundle-artifact-${{ matrix.ruby-platform }}
path: pkg/
build_source:
name: Build source gem
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oxidize-rb/actions/setup-ruby-and-rust@main
with:
ruby-version: "3.3"
bundler-cache: false
cargo-cache: true
cargo-vendor: true
- name: Build gem
run: |
gem build rucaptcha.gemspec
mkdir -p pkg/
mv *.gem pkg/
- name: Upload Gem
uses: actions/upload-artifact@v4
with:
name: bundle-artifact-source
path: pkg/
publish:
name: Publish cross gems
runs-on: ubuntu-latest
needs:
- build
- build_source
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: bundle-artifact-*
merge-multiple: true
path: pkg/
- name: Display structure of built gems
run: ls -R pkg/
- name: Publish to RubyGem
env:
RUBYGEM_TOKEN: "${{secrets.RUBYGEM_TOKEN}}"
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${RUBYGEM_TOKEN}\n" > $HOME/.gem/credentials
for filename in pkg/*.gem; do
echo $filename
gem push $filename
done
- name: Install RubyGem & Test Run
run: |
gem install rucaptcha --prerelease --verbose