@@ -20,11 +20,12 @@ jobs:
2020 ### Jemalloc ###
2121
2222 <%- distributions.each do |distribution| %>
23+ <%- architectures.each do |arch| %>
2324 <%- unindent(2) do -%>
24- build_jemalloc_<%= slug(distribution[:name]) %> :
25- name: 'Jemalloc [<%= distribution[:name] %> ]'
25+ build_jemalloc_<%= slug(distribution[:name]) %> _ <%= arch %> :
26+ name: 'Jemalloc [<%= distribution[:name] %> / <%= arch %> ]'
2627 if: contains(inputs.necessary_jobs, ';Build Jemalloc [<%= distribution[:name] %> ];')
27- runs-on: ubuntu-24.04
28+ runs-on: <%= arch == 'arm64' ? ' ubuntu-24.04-arm' : 'ubuntu-24.04' %>
2829 environment: test
2930 permissions:
3031 id-token: write
5253 run: ./internal-scripts/ci-cd/download-artifact.sh
5354 if: contains(inputs.necessary_jobs, ';Use locally-built Docker image <%= distribution [ :name ] %> ;')
5455 env:
55- ARTIFACT_NAME: '<%= docker_image_artifact_name ( distribution [ :name ] ) %> '
56+ ARTIFACT_NAME: '<%= docker_image_artifact_name ( distribution [ :name ] ) %> - <%= arch %> '
5657 ARTIFACT_PATH: .
5758 CI_ARTIFACTS_BUCKET: ${{ vars.CI_ARTIFACTS_BUCKET }}
5859 - name: Load Docker image necessary for building
@@ -73,14 +74,16 @@ jobs:
7374 env:
7475 ENVIRONMENT_NAME: '<%= distribution [ :name ] %> '
7576 CACHE_KEY_PREFIX: 'sccache/<%= distribution [ :name ] %> '
77+ ARCH: '<%= arch %> '
7678
7779 - name: Archive artifact
7880 run: ./internal-scripts/ci-cd/upload-artifact.sh
7981 env:
80- ARTIFACT_NAME: 'jemalloc-bin-<%= distribution [ :name ] %> '
82+ ARTIFACT_NAME: 'jemalloc-bin-<%= distribution [ :name ] %> - <%= arch %> '
8183 ARTIFACT_PATH: output
8284 CI_ARTIFACTS_BUCKET: ${{ vars.CI_ARTIFACTS_BUCKET }}
8385 <%- end -%>
86+ <%- end -%>
8487 <%- end %>
8588
8689
@@ -89,15 +92,16 @@ jobs:
8992 <%- distributions . each do |distribution | %>
9093 <%- ruby_package_versions_for_distro ( distribution ) . each do |ruby_package_version | -%>
9194 <%- variants . each do |variant | -%>
95+ <%- architectures . each do |arch | -%>
9296 <%- unindent ( 2 ) do %>
93- build_ruby_<%= slug ( distribution [ :name ] ) %> -<%= slug ( ruby_package_version [ :id ] ) %> -<%= slug ( variant [ :name ] ) %> :
94- name: 'Ruby [<%= distribution [ :name ] %> /<%= ruby_package_version [ :id ] %> /<%= variant [ :name ] %> ]'
97+ build_ruby_<%= slug ( distribution [ :name ] ) %> -<%= slug ( ruby_package_version [ :id ] ) %> -<%= slug ( variant [ :name ] ) %> _ <%= arch %> :
98+ name: 'Ruby [<%= distribution [ :name ] %> /<%= ruby_package_version [ :id ] %> /<%= variant [ :name ] %> / <%= arch %> ]'
9599 <%- if variant [ :name ] == 'jemalloc' %>
96100 <%- unindent ( 2 ) do -%>
97- needs: build_jemalloc_<%= slug ( distribution [ :name ] ) %>
101+ needs: build_jemalloc_<%= slug ( distribution [ :name ] ) %> _ <%= arch %>
98102 <%- end -%>
99103 <%- end %>
100- runs-on: ubuntu-24.04
104+ runs-on: <%= arch == 'arm64' ? ' ubuntu-24.04-arm' : 'ubuntu-24.04' %>
101105 environment: test
102106 timeout-minutes: 30
103107 permissions:
@@ -110,10 +114,10 @@ jobs:
110114 steps:
111115 <% if variant [ :name ] == 'jemalloc' %>
112116 <%- unindent ( 2 ) do -%>
113- - name: Check whether 'Build Jemalloc [<%= distribution [ :name ] %> ]' did not fail
117+ - name: Check whether 'Build Jemalloc [<%= distribution [ :name ] %> / <%= arch %> ]' did not fail
114118 run: 'false'
115119 if: |
116- needs.build_jemalloc_<%= slug ( distribution [ :name ] ) %> .result == 'skipped'
120+ needs.build_jemalloc_<%= slug ( distribution [ :name ] ) %> _ <%= arch %> .result == 'skipped'
117121 && contains(inputs.necessary_jobs, ';Build Jemalloc [<%= distribution [ :name ] %> ];')
118122 <%- end -%>
119123 <% end %>
@@ -146,7 +150,7 @@ jobs:
146150 run: ./internal-scripts/ci-cd/download-artifact.sh
147151 if: contains(inputs.necessary_jobs, ';Use locally-built Docker image <%= distribution [ :name ] %> ;')
148152 env:
149- ARTIFACT_NAME: '<%= docker_image_artifact_name ( distribution [ :name ] ) %> '
153+ ARTIFACT_NAME: '<%= docker_image_artifact_name ( distribution [ :name ] ) %> - <%= arch %> '
150154 ARTIFACT_PATH: .
151155 CI_ARTIFACTS_BUCKET: ${{ vars.CI_ARTIFACTS_BUCKET }}
152156 - name: Load Docker image necessary for building
@@ -159,7 +163,7 @@ jobs:
159163 run: ./internal-scripts/ci-cd/download-artifact.sh
160164 if: contains(inputs.necessary_jobs, ';Use locally-built Docker image utility;')
161165 env:
162- ARTIFACT_NAME: <%= docker_image_artifact_name ( 'utility' ) %>
166+ ARTIFACT_NAME: <%= docker_image_artifact_name ( 'utility' ) %> - <%= arch %>
163167 ARTIFACT_PATH: .
164168 CI_ARTIFACTS_BUCKET: ${{ vars.CI_ARTIFACTS_BUCKET }}
165169 - name: Load Docker image necessary for packaging
@@ -173,7 +177,7 @@ jobs:
173177 - name: Fetch Jemalloc binary
174178 run: ./internal-scripts/ci-cd/download-artifact.sh
175179 env:
176- ARTIFACT_NAME: jemalloc-bin-<%= distribution [ :name ] %>
180+ ARTIFACT_NAME: jemalloc-bin-<%= distribution [ :name ] %> - <%= arch %>
177181 ARTIFACT_PATH: .
178182 CI_ARTIFACTS_BUCKET: ${{ vars.CI_ARTIFACTS_BUCKET }}
179183 <%- end -%>
@@ -186,6 +190,7 @@ jobs:
186190 VARIANT_NAME: "<%= variant [ :name ] %> "
187191 RUBY_PACKAGE_VERSION_ID: "<%= ruby_package_version [ :id ] %> "
188192 CACHE_KEY_PREFIX: "sccache/<%= distribution [ :name ] %> "
193+ ARCH: "<%= arch %> "
189194
190195 - name: Build package
191196 run: ./internal-scripts/ci-cd/build-ruby-packages/build-package.sh
@@ -196,6 +201,7 @@ jobs:
196201 PACKAGE_FORMAT: "<%= distribution [ :package_format ] %> "
197202 RUBY_PACKAGE_VERSION_ID: "<%= ruby_package_version [ :id ] %> "
198203 RUBY_PACKAGE_REVISION: "<%= ruby_package_version [ :package_revision ] %> "
204+ ARCH: "<%= arch %> "
199205
200206 - name: Archive package artifact to Google Cloud
201207 run: ./internal-scripts/ci-cd/upload-artifact.sh
@@ -207,6 +213,7 @@ jobs:
207213 <%- end -%>
208214 <%- end -%>
209215 <%- end %>
216+ <%- end -%>
210217
211218
212219 ### Finalize ###
@@ -216,10 +223,14 @@ jobs:
216223 needs:
217224 <%- distributions . each do |distribution | -%>
218225 <%- unindent ( 2 ) do %>
219- - build_jemalloc_<%= slug ( distribution [ :name ] ) %>
226+ <%- architectures . each do |arch | -%>
227+ - build_jemalloc_<%= slug ( distribution [ :name ] ) %> _<%= arch %>
228+ <%- end -%>
220229 <%- ruby_package_versions_for_distro ( distribution ) . each do |ruby_package_version | %>
221230 <%- variants . each do |variant | -%>
222- - build_ruby_<%= slug ( distribution [ :name ] ) %> -<%= slug ( ruby_package_version [ :id ] ) %> -<%= slug ( variant [ :name ] ) %>
231+ <%- architectures . each do |arch | -%>
232+ - build_ruby_<%= slug ( distribution [ :name ] ) %> -<%= slug ( ruby_package_version [ :id ] ) %> -<%= slug ( variant [ :name ] ) %> _<%= arch %>
233+ <%- end -%>
223234 <%- end -%>
224235 <%- end %>
225236 <%- end %>
@@ -252,19 +263,23 @@ jobs:
252263 env:
253264 ARTIFACT_NAMES: |
254265 <%- distributions . each do |distribution | -%>
255- jemalloc-bin-<%= distribution [ :name ] %>
266+ <%- architectures . each do |arch | -%>
267+ jemalloc-bin-<%= distribution [ :name ] %> -<%= arch %>
268+ <%- end -%>
256269 <%- end -%>
257270 ARTIFACT_PATH: artifacts
258271 CLEAR: true
259272 CI_ARTIFACTS_BUCKET: ${{ vars.CI_ARTIFACTS_BUCKET }}
260273 <%- distributions . each do |distribution | -%>
261- - name: Archive Jemalloc binary artifact [<%= distribution [ :name ] %> ] to Github
274+ <%- architectures . each do |arch | -%>
275+ - name: Archive Jemalloc binary artifact [<%= distribution [ :name ] %> /<%= arch %> ] to Github
262276 uses: actions/upload-artifact@v4
263277 with:
264- name: 'jemalloc-bin-<%= distribution [ :name ] %> '
265- path: 'artifacts/jemalloc-bin-<%= distribution [ :name ] %> '
278+ name: 'jemalloc-bin-<%= distribution [ :name ] %> - <%= arch %> '
279+ path: 'artifacts/jemalloc-bin-<%= distribution [ :name ] %> - <%= arch %> '
266280 compression-level: 0
267281 <%- end -%>
282+ <%- end -%>
268283
269284 - name: Download Ruby package artifacts from Google Cloud
270285 run: ./internal-scripts/ci-cd/download-artifacts.sh
@@ -290,20 +305,24 @@ jobs:
290305 if: |
291306 false
292307 <%- distributions . each do |distribution | -%>
293- || (needs.build_jemalloc_<%= slug ( distribution [ :name ] ) %> .result != 'success'
294- && (needs.build_jemalloc_<%= slug ( distribution [ :name ] ) %> .result != 'skipped'
308+ <%- architectures . each do |arch | -%>
309+ || (needs.build_jemalloc_<%= slug ( distribution [ :name ] ) %> _<%= arch %> .result != 'success'
310+ && (needs.build_jemalloc_<%= slug ( distribution [ :name ] ) %> _<%= arch %> .result != 'skipped'
295311 || contains(inputs.necessary_jobs, ';Build Jemalloc [<%= distribution [ :name ] %> ];')))
296312 <%- end -%>
313+ <%- end -%>
297314 <%- distributions . each do |distribution | -%>
298315 - name: Check whether 'Ruby [<%= distribution [ :name ] %> ]' job did not fail
299316 run: 'false'
300317 if: |
301318 false
302319 <%- ruby_package_versions_for_distro ( distribution ) . each do |ruby_package_version | -%>
303320 <%- variants . each do |variant | -%>
304- || (needs.build_ruby_<%= slug ( distribution [ :name ] ) %> -<%= slug ( ruby_package_version [ :id ] ) %> -<%= slug ( variant [ :name ] ) %> .result != 'success'
305- && (needs.build_ruby_<%= slug ( distribution [ :name ] ) %> -<%= slug ( ruby_package_version [ :id ] ) %> -<%= slug ( variant [ :name ] ) %> .result != 'skipped'
321+ <%- architectures . each do |arch | -%>
322+ || (needs.build_ruby_<%= slug ( distribution [ :name ] ) %> -<%= slug ( ruby_package_version [ :id ] ) %> -<%= slug ( variant [ :name ] ) %> _<%= arch %> .result != 'success'
323+ && (needs.build_ruby_<%= slug ( distribution [ :name ] ) %> -<%= slug ( ruby_package_version [ :id ] ) %> -<%= slug ( variant [ :name ] ) %> _<%= arch %> .result != 'skipped'
306324 || contains(inputs.necessary_jobs, ';Build Ruby [<%= distribution [ :name ] %> /<%= ruby_package_version [ :id ] %> /<%= variant [ :name ] %> ];')))
307325 <%- end -%>
308326 <%- end -%>
327+ <%- end -%>
309328 <%- end -%>
0 commit comments