-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (71 loc) · 2.37 KB
/
Copy pathrelease.yml
File metadata and controls
82 lines (71 loc) · 2.37 KB
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
name: Release
on:
push:
tags: ["v*"]
permissions:
contents: read
id-token: write
env:
# Supported Ruby versions (keep in sync with CI matrix and gemspec)
RUBY_VERSIONS: "3.4,4.0"
jobs:
build:
name: Build native gems
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-platform:
- x86_64-linux
- aarch64-linux
- x86_64-darwin
- arm64-darwin
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ruby/setup-ruby@c984c1a20bb35a1cbda04477c816cea024418be9 # v1.294.0
with:
ruby-version: "3.4"
bundler-cache: true
- uses: oxidize-rb/actions/cross-gem@e5f9a49a7812a078584072f6e3f657ad247c8771 # v1.4.4
with:
platform: ${{ matrix.ruby-platform }}
ruby-versions: ${{ env.RUBY_VERSIONS }}
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: cross-gem-${{ matrix.ruby-platform }}
path: pkg/*-${{ matrix.ruby-platform }}.gem
release:
name: Release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1.229.0
with:
ruby-version: "3.4"
bundler-cache: true
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: cross-gem-*
merge-multiple: true
path: pkg/
- name: Build source gem
run: bundle exec rake build
- name: Verify version matches tag
run: |
GEM_VERSION=$(ruby -r./lib/libsql/version -e "puts Libsql::VERSION")
if [ "v$GEM_VERSION" != "${{ github.ref_name }}" ]; then
echo "::error::Version mismatch: v$GEM_VERSION != ${{ github.ref_name }}"
exit 1
fi
- name: List gems to publish
run: ls -lh pkg/*.gem
- name: Configure RubyGems Trusted Publisher credentials
uses: rubygems/configure-rubygems-credentials@bc6dd217f8a4f919d6835fcfefd470ef821f5c44 # v1.0.0
- name: Push to RubyGems
working-directory: pkg/
run: |
for gem in *.gem; do
echo "Pushing $gem"
gem push "$gem"
done