-
Notifications
You must be signed in to change notification settings - Fork 211
108 lines (104 loc) · 3.94 KB
/
build-gems.yml
File metadata and controls
108 lines (104 loc) · 3.94 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Build gems
on:
workflow_call:
inputs:
release:
description: "Pass --release to bin/test-gem-build (skip timestamp version)"
type: boolean
default: false
artifact_prefix:
description: "Prefix for artifact names (e.g., 'release-v2.9.1-')"
type: string
default: ""
ref:
description: "Git ref to check out (e.g., a version tag). Defaults to the caller's ref."
type: string
default: ""
permissions:
contents: read
jobs:
native_setup:
name: "Setup for native gem build"
runs-on: ubuntu-latest
outputs:
rcd_image_version: ${{ steps.rcd_image_version.outputs.rcd_image_version }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.ref || github.ref }}
persist-credentials: false
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ports/archives
key: ports-archives-tarball-${{ hashFiles('ext/sqlite3/extconf.rb','dependencies.yml') }}
- uses: ruby/setup-ruby@7372622e62b60b3cb750dcd2b9e32c247ffec26a # v1.302.0
with:
ruby-version: "4.0"
bundler-cache: true
- run: bundle exec ruby ./ext/sqlite3/extconf.rb --download-dependencies
- id: rcd_image_version
run: bundle exec ruby -e 'require "rake_compiler_dock"; puts "rcd_image_version=#{RakeCompilerDock::IMAGE_VERSION}"' >> $GITHUB_OUTPUT
build_source_gem:
name: "build source"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.ref || github.ref }}
persist-credentials: false
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ports/archives
key: ports-archives-tarball-${{ hashFiles('ext/sqlite3/extconf.rb','dependencies.yml') }}
- uses: ruby/setup-ruby@7372622e62b60b3cb750dcd2b9e32c247ffec26a # v1.302.0
with:
ruby-version: "4.0"
bundler-cache: true
- run: ./bin/test-gem-build ${RELEASE_FLAG} gems ruby
env:
RELEASE_FLAG: ${{ inputs.release && '--release' || '' }}
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: "${{ inputs.artifact_prefix }}source-gem"
path: gems
retention-days: 1
build_native_gem:
needs: native_setup
name: "build native"
strategy:
fail-fast: false
matrix:
platform:
- aarch64-linux-gnu
- aarch64-linux-musl
- arm-linux-gnu
- arm-linux-musl
- arm64-darwin
- x64-mingw-ucrt
- x86-linux-gnu
- x86-linux-musl
- x86_64-darwin
- x86_64-linux-gnu
- x86_64-linux-musl
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.ref || github.ref }}
persist-credentials: false
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ports/archives
key: ports-archives-tarball-${{ hashFiles('ext/sqlite3/extconf.rb', 'dependencies.yml') }}
- run: |
docker run --rm -v $PWD:/work -w /work \
ghcr.io/rake-compiler/rake-compiler-dock-image:${RCD_IMAGE_VERSION}-mri-${{ matrix.platform }} \
./bin/test-gem-build ${RELEASE_FLAG} gems ${{ matrix.platform }}
env:
RCD_IMAGE_VERSION: ${{ needs.native_setup.outputs.rcd_image_version }}
RELEASE_FLAG: ${{ inputs.release && '--release' || '' }}
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: "${{ inputs.artifact_prefix }}cruby-${{ matrix.platform }}-gem"
path: gems
retention-days: 1