@@ -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] %> ]'
26- if: contains(inputs.necessary_jobs, ';Build Jemalloc [<%= distribution[:name] %> ];')
27- runs-on: ubuntu-24.04
25+ build_jemalloc_<%= slug(distribution[:name]) %> _ <%= arch %> :
26+ name: 'Jemalloc [<%= distribution[:name] %> / <%= arch %> ]'
27+ if: contains(inputs.necessary_jobs, ';Build Jemalloc [<%= distribution[:name] %> / <%= arch %> ];')
28+ runs-on: <%= arch == 'arm64' ? ' ubuntu-24.04-arm' : 'ubuntu-24.04' %>
2829 environment: test
2930 permissions:
3031 id-token: write
5455 run: ./internal-scripts/ci-cd/download-artifact.sh
5556 if: contains(inputs.necessary_jobs, ';Use locally-built Docker image <%= distribution [ :name ] %> ;')
5657 env:
57- ARTIFACT_NAME: '<%= docker_image_artifact_name ( distribution [ :name ] ) %> '
58+ ARTIFACT_NAME: '<%= docker_image_artifact_name ( distribution [ :name ] ) %> - <%= arch %> '
5859 ARTIFACT_PATH: .
5960 CI_ARTIFACTS_BUCKET: ${{ vars.CI_ARTIFACTS_BUCKET }}
6061 - name: Load Docker image necessary for building
@@ -73,16 +74,17 @@ jobs:
7374 - name: Build
7475 run: ./internal-scripts/ci-cd/build-jemalloc-binaries/build.sh
7576 env:
76- ENVIRONMENT_NAME: ' <%= distribution [ :name ] %> '
77- CACHE_KEY_PREFIX: ' sccache/<%= distribution [ :name ] %> '
77+ ENVIRONMENT_NAME: " <%= distribution [ :name ] %> "
78+ CACHE_KEY_PREFIX: " sccache/<%= distribution [ :name ] %> / <%= arch %> "
7879
7980 - name: Archive artifact
8081 run: ./internal-scripts/ci-cd/upload-artifact.sh
8182 env:
82- ARTIFACT_NAME: 'jemalloc-bin-<%= distribution [ :name ] %> '
83+ ARTIFACT_NAME: 'jemalloc-bin-<%= distribution [ :name ] %> - <%= arch %> '
8384 ARTIFACT_PATH: output
8485 CI_ARTIFACTS_BUCKET: ${{ vars.CI_ARTIFACTS_BUCKET }}
8586 <%- end -%>
87+ <%- end -%>
8688 <%- end %>
8789
8890
@@ -91,34 +93,35 @@ jobs:
9193 <%- distributions . each do |distribution | %>
9294 <%- ruby_package_versions_for_distro ( distribution ) . each do |ruby_package_version | -%>
9395 <%- variants . each do |variant | -%>
96+ <%- architectures . each do |arch | -%>
9497 <%- unindent ( 2 ) do %>
95- build_ruby_<%= slug ( distribution [ :name ] ) %> -<%= slug ( ruby_package_version [ :id ] ) %> -<%= slug ( variant [ :name ] ) %> :
96- name: 'Ruby [<%= distribution [ :name ] %> /<%= ruby_package_version [ :id ] %> /<%= variant [ :name ] %> ]'
98+ build_ruby_<%= slug ( distribution [ :name ] ) %> -<%= slug ( ruby_package_version [ :id ] ) %> -<%= slug ( variant [ :name ] ) %> _ <%= arch %> :
99+ name: 'Ruby [<%= distribution [ :name ] %> /<%= ruby_package_version [ :id ] %> /<%= variant [ :name ] %> / <%= arch %> ]'
97100 <%- if variant [ :name ] == 'jemalloc' %>
98101 <%- unindent ( 2 ) do -%>
99- needs: build_jemalloc_<%= slug ( distribution [ :name ] ) %>
102+ needs: build_jemalloc_<%= slug ( distribution [ :name ] ) %> _ <%= arch %>
100103 <%- end -%>
101104 <%- end %>
102- runs-on: ubuntu-24.04
105+ runs-on: <%= arch == 'arm64' ? ' ubuntu-24.04-arm' : 'ubuntu-24.04' %>
103106 environment: test
104107 timeout-minutes: 30
105108 permissions:
106109 id-token: write
107110 packages: read
108111 # Run even if a dependent job has been skipped
109112 if: |
110- contains(inputs.necessary_jobs, ';Build Ruby [<%= distribution [ :name ] %> /<%= ruby_package_version [ :id ] %> /<%= variant [ :name ] %> ];')
113+ contains(inputs.necessary_jobs, ';Build Ruby [<%= distribution [ :name ] %> /<%= ruby_package_version [ :id ] %> /<%= variant [ :name ] %> / <%= arch %> ];')
111114 && !failure() && !cancelled()
112115 steps:
113- <% if variant [ :name ] == 'jemalloc' %>
116+ <%- if variant [ :name ] == 'jemalloc' - %>
114117 <%- unindent ( 2 ) do -%>
115- - name: Check whether 'Build Jemalloc [<%= distribution [ :name ] %> ]' did not fail
118+ - name: Check whether 'Build Jemalloc [<%= distribution [ :name ] %> / <%= arch %> ]' did not fail
116119 run: 'false'
117120 if: |
118- needs.build_jemalloc_<%= slug ( distribution [ :name ] ) %> .result == 'skipped'
119- && contains(inputs.necessary_jobs, ';Build Jemalloc [<%= distribution [ :name ] %> ];')
121+ needs.build_jemalloc_<%= slug ( distribution [ :name ] ) %> _ <%= arch %> .result == 'skipped'
122+ && contains(inputs.necessary_jobs, ';Build Jemalloc [<%= distribution [ :name ] %> / <%= arch %> ];')
120123 <%- end -%>
121- <% end %>
124+ <%- end %>
122125
123126 - uses: actions/checkout@v5
124127 - uses: google-github-actions/auth@v3
@@ -150,7 +153,7 @@ jobs:
150153 run: ./internal-scripts/ci-cd/download-artifact.sh
151154 if: contains(inputs.necessary_jobs, ';Use locally-built Docker image <%= distribution [ :name ] %> ;')
152155 env:
153- ARTIFACT_NAME: '<%= docker_image_artifact_name ( distribution [ :name ] ) %> '
156+ ARTIFACT_NAME: '<%= docker_image_artifact_name ( distribution [ :name ] ) %> - <%= arch %> '
154157 ARTIFACT_PATH: .
155158 CI_ARTIFACTS_BUCKET: ${{ vars.CI_ARTIFACTS_BUCKET }}
156159 - name: Load Docker image necessary for building
@@ -163,7 +166,7 @@ jobs:
163166 run: ./internal-scripts/ci-cd/download-artifact.sh
164167 if: contains(inputs.necessary_jobs, ';Use locally-built Docker image utility;')
165168 env:
166- ARTIFACT_NAME: <%= docker_image_artifact_name ( 'utility' ) %>
169+ ARTIFACT_NAME: <%= docker_image_artifact_name ( 'utility' ) %> - <%= arch %>
167170 ARTIFACT_PATH: .
168171 CI_ARTIFACTS_BUCKET: ${{ vars.CI_ARTIFACTS_BUCKET }}
169172 - name: Load Docker image necessary for packaging
@@ -172,24 +175,24 @@ jobs:
172175 env:
173176 TARBALL: image.tar.zst
174177
175- <% if variant [ :name ] == 'jemalloc' %>
178+ <%- if variant [ :name ] == 'jemalloc' - %>
176179 <%- unindent ( 2 ) do -%>
177180 - name: Fetch Jemalloc binary
178181 run: ./internal-scripts/ci-cd/download-artifact.sh
179182 env:
180- ARTIFACT_NAME: jemalloc-bin-<%= distribution [ :name ] %>
183+ ARTIFACT_NAME: jemalloc-bin-<%= distribution [ :name ] %> - <%= arch %>
181184 ARTIFACT_PATH: .
182185 CI_ARTIFACTS_BUCKET: ${{ vars.CI_ARTIFACTS_BUCKET }}
183186 <%- end -%>
184- <% end %>
187+ <%- end %>
185188
186189 - name: Build binaries
187190 run: ./internal-scripts/ci-cd/build-ruby-packages/build-binaries.sh
188191 env:
189192 ENVIRONMENT_NAME: "<%= distribution [ :name ] %> "
190193 VARIANT_NAME: "<%= variant [ :name ] %> "
191194 RUBY_PACKAGE_VERSION_ID: "<%= ruby_package_version [ :id ] %> "
192- CACHE_KEY_PREFIX: "sccache/<%= distribution [ :name ] %> "
195+ CACHE_KEY_PREFIX: "sccache/<%= distribution [ :name ] %> / <%= arch %> "
193196
194197 - name: Build package
195198 run: ./internal-scripts/ci-cd/build-ruby-packages/build-package.sh
@@ -200,17 +203,19 @@ jobs:
200203 PACKAGE_FORMAT: "<%= distribution [ :package_format ] %> "
201204 RUBY_PACKAGE_VERSION_ID: "<%= ruby_package_version [ :id ] %> "
202205 RUBY_PACKAGE_REVISION: "<%= ruby_package_version [ :package_revision ] %> "
206+ ARCH: "<%= arch %> "
203207
204208 - name: Archive package artifact to Google Cloud
205209 run: ./internal-scripts/ci-cd/upload-artifact.sh
206210 env:
207- ARTIFACT_NAME: "<%= ruby_package_artifact_name ( ruby_package_version , distribution , variant ) %> "
211+ ARTIFACT_NAME: "<%= ruby_package_artifact_name ( ruby_package_version , distribution , variant , arch ) %> "
208212 ARTIFACT_PATH: output-<%= variant [ :name ] %>
209213 CI_ARTIFACTS_BUCKET: ${{ vars.CI_ARTIFACTS_BUCKET }}
210214 <%- end %>
211215 <%- end -%>
212216 <%- end -%>
213217 <%- end %>
218+ <%- end -%>
214219
215220
216221 ### Finalize ###
@@ -220,10 +225,14 @@ jobs:
220225 needs:
221226 <%- distributions . each do |distribution | -%>
222227 <%- unindent ( 2 ) do %>
223- - build_jemalloc_<%= slug ( distribution [ :name ] ) %>
228+ <%- architectures . each do |arch | -%>
229+ - build_jemalloc_<%= slug ( distribution [ :name ] ) %> _<%= arch %>
230+ <%- end -%>
224231 <%- ruby_package_versions_for_distro ( distribution ) . each do |ruby_package_version | %>
225232 <%- variants . each do |variant | -%>
226- - build_ruby_<%= slug ( distribution [ :name ] ) %> -<%= slug ( ruby_package_version [ :id ] ) %> -<%= slug ( variant [ :name ] ) %>
233+ <%- architectures . each do |arch | -%>
234+ - build_ruby_<%= slug ( distribution [ :name ] ) %> -<%= slug ( ruby_package_version [ :id ] ) %> -<%= slug ( variant [ :name ] ) %> _<%= arch %>
235+ <%- end -%>
227236 <%- end -%>
228237 <%- end %>
229238 <%- end %>
@@ -256,19 +265,23 @@ jobs:
256265 env:
257266 ARTIFACT_NAMES: |
258267 <%- distributions . each do |distribution | -%>
259- jemalloc-bin-<%= distribution [ :name ] %>
268+ <%- architectures . each do |arch | -%>
269+ jemalloc-bin-<%= distribution [ :name ] %> -<%= arch %>
270+ <%- end -%>
260271 <%- end -%>
261272 ARTIFACT_PATH: artifacts
262273 CLEAR: true
263274 CI_ARTIFACTS_BUCKET: ${{ vars.CI_ARTIFACTS_BUCKET }}
264275 <%- distributions . each do |distribution | -%>
265- - name: Archive Jemalloc binary artifact [<%= distribution [ :name ] %> ] to Github
276+ <%- architectures . each do |arch | -%>
277+ - name: Archive Jemalloc binary artifact [<%= distribution [ :name ] %> /<%= arch %> ] to Github
266278 uses: actions/upload-artifact@v4
267279 with:
268- name: 'jemalloc-bin-<%= distribution [ :name ] %> '
269- path: 'artifacts/jemalloc-bin-<%= distribution [ :name ] %> '
280+ name: 'jemalloc-bin-<%= distribution [ :name ] %> - <%= arch %> '
281+ path: 'artifacts/jemalloc-bin-<%= distribution [ :name ] %> - <%= arch %> '
270282 compression-level: 0
271283 <%- end -%>
284+ <%- end -%>
272285
273286 - name: Download Ruby package artifacts from Google Cloud
274287 run: ./internal-scripts/ci-cd/download-artifacts.sh
@@ -294,9 +307,11 @@ jobs:
294307 if: |
295308 false
296309 <%- distributions . each do |distribution | -%>
297- || (needs.build_jemalloc_<%= slug ( distribution [ :name ] ) %> .result != 'success'
298- && (needs.build_jemalloc_<%= slug ( distribution [ :name ] ) %> .result != 'skipped'
299- || contains(inputs.necessary_jobs, ';Build Jemalloc [<%= distribution [ :name ] %> ];')))
310+ <%- architectures . each do |arch | -%>
311+ || (needs.build_jemalloc_<%= slug ( distribution [ :name ] ) %> _<%= arch %> .result != 'success'
312+ && (needs.build_jemalloc_<%= slug ( distribution [ :name ] ) %> _<%= arch %> .result != 'skipped'
313+ || contains(inputs.necessary_jobs, ';Build Jemalloc [<%= distribution [ :name ] %> /<%= arch %> ];')))
314+ <%- end -%>
300315 <%- end -%>
301316 <%- distributions . each do |distribution | -%>
302317 - name: Check whether 'Ruby [<%= distribution [ :name ] %> ]' job did not fail
@@ -305,9 +320,11 @@ jobs:
305320 false
306321 <%- ruby_package_versions_for_distro ( distribution ) . each do |ruby_package_version | -%>
307322 <%- variants . each do |variant | -%>
308- || (needs.build_ruby_<%= slug ( distribution [ :name ] ) %> -<%= slug ( ruby_package_version [ :id ] ) %> -<%= slug ( variant [ :name ] ) %> .result != 'success'
309- && (needs.build_ruby_<%= slug ( distribution [ :name ] ) %> -<%= slug ( ruby_package_version [ :id ] ) %> -<%= slug ( variant [ :name ] ) %> .result != 'skipped'
323+ <%- architectures . each do |arch | -%>
324+ || (needs.build_ruby_<%= slug ( distribution [ :name ] ) %> -<%= slug ( ruby_package_version [ :id ] ) %> -<%= slug ( variant [ :name ] ) %> _<%= arch %> .result != 'success'
325+ && (needs.build_ruby_<%= slug ( distribution [ :name ] ) %> -<%= slug ( ruby_package_version [ :id ] ) %> -<%= slug ( variant [ :name ] ) %> _<%= arch %> .result != 'skipped'
310326 || contains(inputs.necessary_jobs, ';Build Ruby [<%= distribution [ :name ] %> /<%= ruby_package_version [ :id ] %> /<%= variant [ :name ] %> ];')))
311327 <%- end -%>
312328 <%- end -%>
329+ <%- end -%>
313330 <%- end -%>
0 commit comments