Skip to content

Commit 8d728fa

Browse files
committed
Setup release workflow
1 parent f2330e8 commit 8d728fa

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

.github/workflows/release.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Build and Debug Precompiled Gem
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags: ["v*"]
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build:
15+
name: Build Native Gems
16+
strategy:
17+
matrix:
18+
os: [ubuntu-latest, macos-latest]
19+
target:
20+
- default
21+
- aarch64-linux
22+
- x86_64-linux
23+
- x86_64-linux-musl
24+
- aarch64-linux-musl
25+
- x64-mingw-ucrt
26+
- x86_64-darwin
27+
- arm64-darwin
28+
runs-on: ${{ matrix.os }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Setup Ruby
33+
uses: ruby/setup-ruby@v1
34+
with:
35+
bundler-cache: false
36+
37+
- name: Install dependencies
38+
run: sudo apt-get install check
39+
40+
- name: Install Linux build tools
41+
if: runner.os == 'Linux'
42+
run: |
43+
sudo apt-get update
44+
sudo apt-get install -y build-essential
45+
46+
- name: Install macOS build tools
47+
if: runner.os == 'macOS'
48+
run: |
49+
brew update
50+
brew install autoconf automake
51+
52+
- name: Compile C extension
53+
run: |
54+
make
55+
56+
- name: Build gem
57+
run: gem build my_gem.gemspec
58+
59+
- name: Rename artifact for target
60+
run: |
61+
gem_file=$(ls *.gem)
62+
mv "$gem_file" "${gem_file%.gem}-${{ matrix.target }}.gem"
63+
echo "Renamed gem file to: ${gem_file%.gem}-${{ matrix.target }}.gem"
64+
65+
- name: List Generated Gem Artifacts
66+
run: |
67+
echo "Listing generated .gem files:"
68+
ls -al *.gem

0 commit comments

Comments
 (0)