From 8fe72d7785d7526569ef52e06592edc37de13dd4 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Tue, 10 May 2022 18:45:50 -0500 Subject: [PATCH 1/4] Ideally add support for Mac M1 --- node/binary.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/node/binary.js b/node/binary.js index 74f7fe4a..8be0b51e 100644 --- a/node/binary.js +++ b/node/binary.js @@ -22,6 +22,11 @@ const supportedPlatforms = [ architecture: "x64", url: "https://github.com/CircleCI-Public/circleci-cli/releases/download/v0.1.17087/circleci-cli_0.1.17087_darwin_amd64.tar.gz", }, + { + type: "Darwin", + architecture: "arm64", + url: "https://github.com/CircleCI-Public/circleci-cli/releases/download/v0.1.17554/circleci-cli_0.1.17554_darwin_amd64.tar.gz", + }, ]; function getSupportedPlatform() { From 290f501624bbcd1177ae4bb4285d40da5244cefa Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Tue, 10 May 2022 19:20:57 -0500 Subject: [PATCH 2/4] Use the same function to get the paths --- node/binary.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/node/binary.js b/node/binary.js index 8be0b51e..3120edc9 100644 --- a/node/binary.js +++ b/node/binary.js @@ -37,15 +37,21 @@ function getSupportedPlatform() { ); } -function getBinaryPath() { +function getBinaryPath(platform) { + const machinePlatform = platform || getSupportedPlatform(); + return path.join( __dirname, - `../bin/circleci/${getSupportedPlatform().type}/bin/circleci` + '../bin/circleci', + machinePlatform.type, + machinePlatform.architecture, + 'bin', + 'circleci' ); } -function getBinaryUrl() { - const supportedPlatform = getSupportedPlatform(); +function getBinaryUrl(platform) { + const supportedPlatform = platform || getSupportedPlatform(); if (supportedPlatform) { return supportedPlatform.url; @@ -59,18 +65,15 @@ function getBinaryUrl() { } function getBinary(platform) { - const url = getBinaryUrl(); + const url = getBinaryUrl(platform); return new Binary(url, { name: "cirlceci", - installDirectory: path.join( - __dirname, - `../bin/circleci/${platform}` - ), + installDirectory: getBinaryPath(platform), }); } function install() { - supportedPlatforms.forEach((platform) => getBinary(platform.type).install()); + supportedPlatforms.forEach((platform) => getBinary(platform).install()); } function uninstall() { From a28aed1157a2e267dde8d2a875f5daa90d2bd286 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Tue, 10 May 2022 19:38:28 -0500 Subject: [PATCH 3/4] Improve how this gets the binary path --- node/binary.js | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/node/binary.js b/node/binary.js index 3120edc9..c5215480 100644 --- a/node/binary.js +++ b/node/binary.js @@ -37,21 +37,21 @@ function getSupportedPlatform() { ); } -function getBinaryPath(platform) { - const machinePlatform = platform || getSupportedPlatform(); - +function getBinaryPath() { return path.join( __dirname, - '../bin/circleci', - machinePlatform.type, - machinePlatform.architecture, + '../', + 'bin', + 'circleci', + getSupportedPlatform().type, + getSupportedPlatform().architecture, 'bin', 'circleci' ); } -function getBinaryUrl(platform) { - const supportedPlatform = platform || getSupportedPlatform(); +function getBinaryUrl() { + const supportedPlatform = getSupportedPlatform(); if (supportedPlatform) { return supportedPlatform.url; @@ -65,10 +65,17 @@ function getBinaryUrl(platform) { } function getBinary(platform) { - const url = getBinaryUrl(platform); + const url = getBinaryUrl(); return new Binary(url, { name: "cirlceci", - installDirectory: getBinaryPath(platform), + installDirectory: path.join( + __dirname, + '../', + 'bin', + 'circleci', + platform.type, + platform.architecture + ), }); } @@ -77,7 +84,7 @@ function install() { } function uninstall() { - getBinary().uninstall(); + getBinary(getSupportedPlatform()).uninstall(); } module.exports = { From 3dacecf66f1ffab7a30e920a63a0165a194637fa Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Thu, 12 May 2022 22:02:26 -0500 Subject: [PATCH 4/4] Bump the version of the CircleCI binary for Linux --- node/binary.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/binary.js b/node/binary.js index c5215480..eb86b791 100644 --- a/node/binary.js +++ b/node/binary.js @@ -15,7 +15,7 @@ const supportedPlatforms = [ { type: "Linux", architecture: "x64", - url: "https://github.com/CircleCI-Public/circleci-cli/releases/download/v0.1.17087/circleci-cli_0.1.17087_linux_amd64.tar.gz", + url: "https://github.com/CircleCI-Public/circleci-cli/releases/download/v0.1.17554/circleci-cli_0.1.17554_linux_amd64.tar.gz", }, { type: "Darwin",