Skip to content

Commit

Permalink
feat: support linux arm64 for ninja-install
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-ainsel committed Jul 10, 2024
1 parent aa82e7e commit e2bb69e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 12 deletions.
23 changes: 17 additions & 6 deletions actions/setup-ninja/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31988,12 +31988,23 @@ const { https } = __nccwpck_require__(7707)
const AdmZip = __nccwpck_require__(6761)
const HttpsProxyAgent = __nccwpck_require__(7219)

const selectPlatforn = (platform) =>
platform ? [null, platform] :
process.platform === 'win32' ? [null, 'win'] :
process.platform === 'darwin' ? [null, 'mac'] :
process.platform === 'linux' ? [null, 'linux'] :
[new Error(`Unsupported platform '${process.platform}'`), '']
const selectPlatform = (platform) => {
if (platform) return [null, platform];
switch (process.platform) {
case 'win32':
return [null, 'win'];
case 'darwin':
return [null, 'mac'];
case 'linux':
// Detect if it's ARM64 architecture
if (process.arch === 'arm64') {
return [null, 'linux-aarch64'];
}
return [null, 'linux'];
default:
return [new Error(`Unsupported platform '${process.platform}'`), ''];
}
}

try {
const version = core.getInput('version', {required: true})
Expand Down
23 changes: 17 additions & 6 deletions actions/setup-ninja/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,23 @@ const { https } = require('follow-redirects')
const AdmZip = require('adm-zip')
const HttpsProxyAgent = require('https-proxy-agent')

const selectPlatforn = (platform) =>
platform ? [null, platform] :
process.platform === 'win32' ? [null, 'win'] :
process.platform === 'darwin' ? [null, 'mac'] :
process.platform === 'linux' ? [null, 'linux'] :
[new Error(`Unsupported platform '${process.platform}'`), '']
const selectPlatform = (platform) => {
if (platform) return [null, platform];
switch (process.platform) {
case 'win32':
return [null, 'win'];
case 'darwin':
return [null, 'mac'];
case 'linux':
// Detect if it's ARM64 architecture
if (process.arch === 'arm64') {
return [null, 'linux-aarch64'];
}
return [null, 'linux'];
default:
return [new Error(`Unsupported platform '${process.platform}'`), ''];
}
}

try {
const version = core.getInput('version', {required: true})
Expand Down

0 comments on commit e2bb69e

Please sign in to comment.