Skip to content

Commit 9e2801f

Browse files
committed
/deploy: trigger clang-aarch64 builds when appropriate
Since we now have support to automatically spin up/tear down Windows/ARM64 runners as needed, we will want to make use of that by deploying not only the i686/x86_64 MINGW packages, but by deploying the aarch64 packages, too. Note that the `git-credential-manager`, `git-lfs` and `wintoast` packages are special: Git for Windows does not actually build the ARM64 variants of these packages via clang, but instead either downloads the artifacts from the respective upstream projects or builds using Visual Studio (which supports cross-compiling on hosted agents, in contrast to MSYS2's clang). Therefore, these packages do _not_ require a separate workflow run for ARM64. An alternative to special-casing these packages in the GitForWindowsHelper GitHub App would have been to turn the `build-and-deploy` workflow into a dynamic matrix that spins up a separate job for the `aarch64` architecture if, and when, needed. However, that would have made that workflow even more complex than it already is, and therefore that alternative was rejected. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent b033b93 commit 9e2801f

2 files changed

Lines changed: 40 additions & 3 deletions

File tree

GitForWindowsHelper/component-updates.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ const isMSYSPackage = package_name => {
4141
&& !package_name.startsWith('mingw-w64-')
4242
}
4343

44+
const needsSeparateARM64Build = package_name => {
45+
if (package_name === 'git-extra') return true
46+
return package_name.startsWith('mingw-w64-') && ![
47+
'mingw-w64-git-credential-manager',
48+
'mingw-w64-git-lfs',
49+
'mingw-w64-wintoast'
50+
].includes(package_name)
51+
}
52+
4453
const guessReleaseNotes = (issue) => {
4554
if (!issue.pull_request
4655
&&issue.labels.filter(label => label.name === 'component-update').length !== 1) throw new Error(`Cannot determine release note from issue ${issue.number}`)
@@ -62,5 +71,6 @@ module.exports = {
6271
guessComponentUpdateDetails,
6372
guessReleaseNotes,
6473
prettyPackageName,
65-
isMSYSPackage
74+
isMSYSPackage,
75+
needsSeparateARM64Build
6676
}

GitForWindowsHelper/slash-commands.js

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ module.exports = async (context, req) => {
115115

116116
await checkPermissions()
117117

118-
const { guessComponentUpdateDetails, isMSYSPackage } = require('./component-updates')
118+
const { guessComponentUpdateDetails, isMSYSPackage, needsSeparateARM64Build } = require('./component-updates')
119119
const { package_name } = deployMatch[2]
120120
? { package_name: deployMatch[2] }
121121
: guessComponentUpdateDetails(req.body.issue.title, req.body.issue.body)
@@ -162,6 +162,30 @@ module.exports = async (context, req) => {
162162
text
163163
)
164164
if (!isMSYSPackage(package_name)) {
165+
let aarch64Answer
166+
if (needsSeparateARM64Build(package_name)) {
167+
const aarch64Id = await queueCheckRun(
168+
context,
169+
await getToken(),
170+
'git-for-windows',
171+
repo,
172+
ref,
173+
'deploy_aarch64',
174+
`Build and deploy ${package_name}`,
175+
`Deploying ${package_name}`
176+
)
177+
aarch64Answer = await triggerBuild('aarch64')
178+
await updateCheckRun(
179+
context,
180+
await getToken(),
181+
'git-for-windows',
182+
repo,
183+
aarch64Id, {
184+
details_url: aarch64Answer.html_url
185+
}
186+
)
187+
}
188+
165189
const id = await queueCheckRun(
166190
context,
167191
await getToken(),
@@ -174,7 +198,10 @@ module.exports = async (context, req) => {
174198
)
175199

176200
const answer = await triggerBuild()
177-
const answer2 = await appendToComment(`The workflow run [was started](${answer.html_url})`)
201+
const answer2 = await appendToComment(aarch64Answer
202+
? `The [i686/x86_64](${answer.html_url}) and the [amd64](${aarch64Answer.html_url}) workflow runs were started.`
203+
: `The workflow run [was started](${answer.html_url}).`
204+
)
178205
await updateCheckRun(
179206
context,
180207
await getToken(),

0 commit comments

Comments
 (0)