From ab26b1f6527c3bc892230737edf2ca25a2151ab0 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Thu, 18 Jan 2024 07:48:46 -0800 Subject: [PATCH 1/5] Run from main by default --- action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/action.yml b/action.yml index 0c6ecce..bcc62ab 100644 --- a/action.yml +++ b/action.yml @@ -23,7 +23,6 @@ inputs: source-pr: description: The PR of `magic-nix-cache` to use. Conflicts with all other `source-*` options. required: false - default: 10 source-revision: description: The revision of `nix-magic-nix-cache` to use. Conflicts with all other `source-*` options. required: false From 5d44dc35d8b8c3c5441ebd7acb126cdf2386ac11 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Thu, 18 Jan 2024 11:36:58 -0500 Subject: [PATCH 2/5] go back to ids --- src/index.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 4e79825..2969413 100644 --- a/src/index.ts +++ b/src/index.ts @@ -33,8 +33,7 @@ function getCacherUrl() : string { const runnerArch = process.env.RUNNER_ARCH; const runnerOs = process.env.RUNNER_OS; const binarySuffix = `magic-nix-cache-${runnerArch}-${runnerOs}`; - const urlPrefix = `https://magic-nix-cache-priv20231208150408868500000001.s3.us-east-2.amazonaws.com`; - + const urlPrefix = `https://install.determinate.systems/magic-nix-cache-priv`; if (core.getInput('source-url')) { return core.getInput('source-url'); } @@ -44,7 +43,7 @@ function getCacherUrl() : string { } if (core.getInput('source-pr')) { - return `${urlPrefix}/pr_${core.getInput('source-pr')}/${binarySuffix}`; + return `${urlPrefix}/pr/${core.getInput('source-pr')}/${binarySuffix}`; } if (core.getInput('source-branch')) { From 0876acbf0feb9a104083656af21120c9f4c7e97e Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Thu, 18 Jan 2024 11:41:37 -0500 Subject: [PATCH 3/5] drat --- dist/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 417c77e..b2e1906 100644 --- a/dist/index.js +++ b/dist/index.js @@ -12119,7 +12119,7 @@ function getCacherUrl() { const runnerArch = process.env.RUNNER_ARCH; const runnerOs = process.env.RUNNER_OS; const binarySuffix = `magic-nix-cache-${runnerArch}-${runnerOs}`; - const urlPrefix = `https://magic-nix-cache-priv20231208150408868500000001.s3.us-east-2.amazonaws.com`; + const urlPrefix = `https://install.determinate.systems/magic-nix-cache-priv`; if (coreExports.getInput('source-url')) { return coreExports.getInput('source-url'); } @@ -12127,7 +12127,7 @@ function getCacherUrl() { return `${urlPrefix}/tag/${coreExports.getInput('source-tag')}/${binarySuffix}`; } if (coreExports.getInput('source-pr')) { - return `${urlPrefix}/pr_${coreExports.getInput('source-pr')}/${binarySuffix}`; + return `${urlPrefix}/pr/${coreExports.getInput('source-pr')}/${binarySuffix}`; } if (coreExports.getInput('source-branch')) { return `${urlPrefix}/branch/${coreExports.getInput('source-branch')}/${binarySuffix}`; From 0157564bb230fc4d5e36a1b0e2b4ce8470d899e3 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Thu, 18 Jan 2024 11:58:07 -0500 Subject: [PATCH 4/5] Drop the binary prefix --- dist/index.js | 2 +- src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index b2e1906..242137e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -12118,7 +12118,7 @@ const gotClient = got$1.extend({ function getCacherUrl() { const runnerArch = process.env.RUNNER_ARCH; const runnerOs = process.env.RUNNER_OS; - const binarySuffix = `magic-nix-cache-${runnerArch}-${runnerOs}`; + const binarySuffix = `${runnerArch}-${runnerOs}`; const urlPrefix = `https://install.determinate.systems/magic-nix-cache-priv`; if (coreExports.getInput('source-url')) { return coreExports.getInput('source-url'); diff --git a/src/index.ts b/src/index.ts index 2969413..beac218 100644 --- a/src/index.ts +++ b/src/index.ts @@ -32,7 +32,7 @@ const gotClient = got.extend({ function getCacherUrl() : string { const runnerArch = process.env.RUNNER_ARCH; const runnerOs = process.env.RUNNER_OS; - const binarySuffix = `magic-nix-cache-${runnerArch}-${runnerOs}`; + const binarySuffix = `${runnerArch}-${runnerOs}`; const urlPrefix = `https://install.determinate.systems/magic-nix-cache-priv`; if (core.getInput('source-url')) { return core.getInput('source-url'); From 24f6adfb736cf0c57ab0714a653acd896b58c161 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Thu, 18 Jan 2024 12:23:19 -0500 Subject: [PATCH 5/5] le sigh --- dist/index.js | 2 +- src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 242137e..5831399 100644 --- a/dist/index.js +++ b/dist/index.js @@ -12140,7 +12140,7 @@ function getCacherUrl() { async function fetchAutoCacher() { const binary_url = getCacherUrl(); coreExports.info(`Fetching the Magic Nix Cache from ${binary_url}`); - const { stdout } = await promisify$1(exec)(`curl "${binary_url}" | xz -d | nix-store --import`); + const { stdout } = await promisify$1(exec)(`curl -L "${binary_url}" | xz -d | nix-store --import`); const paths = stdout.split(os$2.EOL); // Since the export is in reverse topologically sorted order, magic-nix-cache is always the penultimate entry in the list (the empty string left by split being the last). const last_path = paths.at(-2); diff --git a/src/index.ts b/src/index.ts index beac218..cf2790e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -61,7 +61,7 @@ async function fetchAutoCacher() { const binary_url = getCacherUrl(); core.info(`Fetching the Magic Nix Cache from ${binary_url}`); - const { stdout } = await promisify(exec)(`curl "${binary_url}" | xz -d | nix-store --import`); + const { stdout } = await promisify(exec)(`curl -L "${binary_url}" | xz -d | nix-store --import`); const paths = stdout.split(os.EOL);