@@ -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
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
@@ -71,16 +72,17 @@ jobs:
7172 - name: Build
7273 run: ./internal-scripts/ci-cd/build-jemalloc-binaries/build.sh
7374 env:
74- ENVIRONMENT_NAME: ' <%= distribution [ :name ] %> '
75- CACHE_KEY_PREFIX: ' sccache/<%= distribution [ :name ] %> '
75+ ENVIRONMENT_NAME: " <%= distribution [ :name ] %> "
76+ CACHE_KEY_PREFIX: " sccache/<%= distribution [ :name ] %> / <%= arch %> "
7677
7778 - name: Archive artifact
7879 run: ./internal-scripts/ci-cd/upload-artifact.sh
7980 env:
80- ARTIFACT_NAME: 'jemalloc-bin-<%= distribution [ :name ] %> '
81+ ARTIFACT_NAME: 'jemalloc-bin-<%= distribution [ :name ] %> - <%= arch %> '
8182 ARTIFACT_PATH: output
8283 CI_ARTIFACTS_BUCKET: ${{ vars.CI_ARTIFACTS_BUCKET }}
8384 <%- end -%>
85+ <%- end -%>
8486 <%- end %>
8587
8688
@@ -89,34 +91,35 @@ jobs:
8991 <%- distributions . each do |distribution | %>
9092 <%- ruby_package_versions_for_distro ( distribution ) . each do |ruby_package_version | -%>
9193 <%- variants . each do |variant | -%>
94+ <%- architectures . each do |arch | -%>
9295 <%- 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 ] %> ]'
96+ build_ruby_<%= slug ( distribution [ :name ] ) %> -<%= slug ( ruby_package_version [ :id ] ) %> -<%= slug ( variant [ :name ] ) %> _ <%= arch %> :
97+ name: 'Ruby [<%= distribution [ :name ] %> /<%= ruby_package_version [ :id ] %> /<%= variant [ :name ] %> / <%= arch %> ]'
9598 <%- if variant [ :name ] == 'jemalloc' %>
9699 <%- unindent ( 2 ) do -%>
97- needs: build_jemalloc_<%= slug ( distribution [ :name ] ) %>
100+ needs: build_jemalloc_<%= slug ( distribution [ :name ] ) %> _ <%= arch %>
98101 <%- end -%>
99102 <%- end %>
100- runs-on: ubuntu-24.04
103+ runs-on: <%= arch == 'arm64' ? ' ubuntu-24.04-arm' : 'ubuntu-24.04' %>
101104 environment: test
102105 timeout-minutes: 30
103106 permissions:
104107 id-token: write
105108 packages: read
106109 # Run even if a dependent job has been skipped
107110 if: |
108- contains(inputs.necessary_jobs, ';Build Ruby [<%= distribution [ :name ] %> /<%= ruby_package_version [ :id ] %> /<%= variant [ :name ] %> ];')
111+ contains(inputs.necessary_jobs, ';Build Ruby [<%= distribution [ :name ] %> /<%= ruby_package_version [ :id ] %> /<%= variant [ :name ] %> / <%= arch %> ];')
109112 && !failure() && !cancelled()
110113 steps:
111114 <% if variant [ :name ] == 'jemalloc' %>
112115 <%- unindent ( 2 ) do -%>
113- - name: Check whether 'Build Jemalloc [<%= distribution [ :name ] %> ]' did not fail
116+ - name: Check whether 'Build Jemalloc [<%= distribution [ :name ] %> / <%= arch %> ]' did not fail
114117 run: 'false'
115118 if: |
116- needs.build_jemalloc_<%= slug ( distribution [ :name ] ) %> .result == 'skipped'
117- && contains(inputs.necessary_jobs, ';Build Jemalloc [<%= distribution [ :name ] %> ];')
119+ needs.build_jemalloc_<%= slug ( distribution [ :name ] ) %> _ <%= arch %> .result == 'skipped'
120+ && contains(inputs.necessary_jobs, ';Build Jemalloc [<%= distribution [ :name ] %> / <%= arch %> ];')
118121 <%- end -%>
119- <% end %>
122+ <%- end %>
120123
121124 - uses: actions/checkout@v4
122125 - uses: google-github-actions/auth@v2
@@ -146,7 +149,7 @@ jobs:
146149 run: ./internal-scripts/ci-cd/download-artifact.sh
147150 if: contains(inputs.necessary_jobs, ';Use locally-built Docker image <%= distribution [ :name ] %> ;')
148151 env:
149- ARTIFACT_NAME: '<%= docker_image_artifact_name ( distribution [ :name ] ) %> '
152+ ARTIFACT_NAME: '<%= docker_image_artifact_name ( distribution [ :name ] ) %> - <%= arch %> '
150153 ARTIFACT_PATH: .
151154 CI_ARTIFACTS_BUCKET: ${{ vars.CI_ARTIFACTS_BUCKET }}
152155 - name: Load Docker image necessary for building
@@ -159,7 +162,7 @@ jobs:
159162 run: ./internal-scripts/ci-cd/download-artifact.sh
160163 if: contains(inputs.necessary_jobs, ';Use locally-built Docker image utility;')
161164 env:
162- ARTIFACT_NAME: <%= docker_image_artifact_name ( 'utility' ) %>
165+ ARTIFACT_NAME: <%= docker_image_artifact_name ( 'utility' ) %> - <%= arch %>
163166 ARTIFACT_PATH: .
164167 CI_ARTIFACTS_BUCKET: ${{ vars.CI_ARTIFACTS_BUCKET }}
165168 - name: Load Docker image necessary for packaging
@@ -173,7 +176,7 @@ jobs:
173176 - name: Fetch Jemalloc binary
174177 run: ./internal-scripts/ci-cd/download-artifact.sh
175178 env:
176- ARTIFACT_NAME: jemalloc-bin-<%= distribution [ :name ] %>
179+ ARTIFACT_NAME: jemalloc-bin-<%= distribution [ :name ] %> - <%= arch %>
177180 ARTIFACT_PATH: .
178181 CI_ARTIFACTS_BUCKET: ${{ vars.CI_ARTIFACTS_BUCKET }}
179182 <%- end -%>
@@ -185,7 +188,7 @@ jobs:
185188 ENVIRONMENT_NAME: "<%= distribution [ :name ] %> "
186189 VARIANT_NAME: "<%= variant [ :name ] %> "
187190 RUBY_PACKAGE_VERSION_ID: "<%= ruby_package_version [ :id ] %> "
188- CACHE_KEY_PREFIX: "sccache/<%= distribution [ :name ] %> "
191+ CACHE_KEY_PREFIX: "sccache/<%= distribution [ :name ] %> / <%= arch %> "
189192
190193 - name: Build package
191194 run: ./internal-scripts/ci-cd/build-ruby-packages/build-package.sh
@@ -196,17 +199,19 @@ jobs:
196199 PACKAGE_FORMAT: "<%= distribution [ :package_format ] %> "
197200 RUBY_PACKAGE_VERSION_ID: "<%= ruby_package_version [ :id ] %> "
198201 RUBY_PACKAGE_REVISION: "<%= ruby_package_version [ :package_revision ] %> "
202+ ARCH: "<%= arch %> "
199203
200204 - name: Archive package artifact to Google Cloud
201205 run: ./internal-scripts/ci-cd/upload-artifact.sh
202206 env:
203- ARTIFACT_NAME: "<%= ruby_package_artifact_name ( ruby_package_version , distribution , variant ) %> "
207+ ARTIFACT_NAME: "<%= ruby_package_artifact_name ( ruby_package_version , distribution , variant , arch ) %> "
204208 ARTIFACT_PATH: output-<%= variant [ :name ] %>
205209 CI_ARTIFACTS_BUCKET: ${{ vars.CI_ARTIFACTS_BUCKET }}
206210 <%- end %>
207211 <%- end -%>
208212 <%- end -%>
209213 <%- end %>
214+ <%- end -%>
210215
211216
212217 ### Finalize ###
@@ -216,10 +221,14 @@ jobs:
216221 needs:
217222 <%- distributions . each do |distribution | -%>
218223 <%- unindent ( 2 ) do %>
219- - build_jemalloc_<%= slug ( distribution [ :name ] ) %>
224+ <%- architectures . each do |arch | -%>
225+ - build_jemalloc_<%= slug ( distribution [ :name ] ) %> _<%= arch %>
226+ <%- end -%>
220227 <%- ruby_package_versions_for_distro ( distribution ) . each do |ruby_package_version | %>
221228 <%- variants . each do |variant | -%>
222- - build_ruby_<%= slug ( distribution [ :name ] ) %> -<%= slug ( ruby_package_version [ :id ] ) %> -<%= slug ( variant [ :name ] ) %>
229+ <%- architectures . each do |arch | -%>
230+ - build_ruby_<%= slug ( distribution [ :name ] ) %> -<%= slug ( ruby_package_version [ :id ] ) %> -<%= slug ( variant [ :name ] ) %> _<%= arch %>
231+ <%- end -%>
223232 <%- end -%>
224233 <%- end %>
225234 <%- end %>
@@ -252,19 +261,23 @@ jobs:
252261 env:
253262 ARTIFACT_NAMES: |
254263 <%- distributions . each do |distribution | -%>
255- jemalloc-bin-<%= distribution [ :name ] %>
264+ <%- architectures . each do |arch | -%>
265+ jemalloc-bin-<%= distribution [ :name ] %> -<%= arch %>
266+ <%- end -%>
256267 <%- end -%>
257268 ARTIFACT_PATH: artifacts
258269 CLEAR: true
259270 CI_ARTIFACTS_BUCKET: ${{ vars.CI_ARTIFACTS_BUCKET }}
260271 <%- distributions . each do |distribution | -%>
261- - name: Archive Jemalloc binary artifact [<%= distribution [ :name ] %> ] to Github
272+ <%- architectures . each do |arch | -%>
273+ - name: Archive Jemalloc binary artifact [<%= distribution [ :name ] %> /<%= arch %> ] to Github
262274 uses: actions/upload-artifact@v4
263275 with:
264- name: 'jemalloc-bin-<%= distribution [ :name ] %> '
265- path: 'artifacts/jemalloc-bin-<%= distribution [ :name ] %> '
276+ name: 'jemalloc-bin-<%= distribution [ :name ] %> - <%= arch %> '
277+ path: 'artifacts/jemalloc-bin-<%= distribution [ :name ] %> - <%= arch %> '
266278 compression-level: 0
267279 <%- end -%>
280+ <%- end -%>
268281
269282 - name: Download Ruby package artifacts from Google Cloud
270283 run: ./internal-scripts/ci-cd/download-artifacts.sh
@@ -290,9 +303,11 @@ jobs:
290303 if: |
291304 false
292305 <%- distributions . each do |distribution | -%>
293- || (needs.build_jemalloc_<%= slug ( distribution [ :name ] ) %> .result != 'success'
294- && (needs.build_jemalloc_<%= slug ( distribution [ :name ] ) %> .result != 'skipped'
295- || contains(inputs.necessary_jobs, ';Build Jemalloc [<%= distribution [ :name ] %> ];')))
306+ <%- architectures . each do |arch | -%>
307+ || (needs.build_jemalloc_<%= slug ( distribution [ :name ] ) %> _<%= arch %> .result != 'success'
308+ && (needs.build_jemalloc_<%= slug ( distribution [ :name ] ) %> _<%= arch %> .result != 'skipped'
309+ || contains(inputs.necessary_jobs, ';Build Jemalloc [<%= distribution [ :name ] %> /<%= arch %> ];')))
310+ <%- end -%>
296311 <%- end -%>
297312 <%- distributions . each do |distribution | -%>
298313 - name: Check whether 'Ruby [<%= distribution [ :name ] %> ]' job did not fail
@@ -301,9 +316,11 @@ jobs:
301316 false
302317 <%- ruby_package_versions_for_distro ( distribution ) . each do |ruby_package_version | -%>
303318 <%- 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'
319+ <%- architectures . each do |arch | -%>
320+ || (needs.build_ruby_<%= slug ( distribution [ :name ] ) %> -<%= slug ( ruby_package_version [ :id ] ) %> -<%= slug ( variant [ :name ] ) %> _<%= arch %> .result != 'success'
321+ && (needs.build_ruby_<%= slug ( distribution [ :name ] ) %> -<%= slug ( ruby_package_version [ :id ] ) %> -<%= slug ( variant [ :name ] ) %> _<%= arch %> .result != 'skipped'
306322 || contains(inputs.necessary_jobs, ';Build Ruby [<%= distribution [ :name ] %> /<%= ruby_package_version [ :id ] %> /<%= variant [ :name ] %> ];')))
307323 <%- end -%>
308324 <%- end -%>
325+ <%- end -%>
309326 <%- end -%>
0 commit comments