mirror of
https://github.com/DeterminateSystems/magic-nix-cache-action.git
synced 2024-12-23 13:32:03 +01:00
Merge pull request #10 from DeterminateSystems/switch-to-ids
go back to ids
This commit is contained in:
commit
bc93e73758
3 changed files with 8 additions and 10 deletions
|
@ -23,7 +23,6 @@ inputs:
|
||||||
source-pr:
|
source-pr:
|
||||||
description: The PR of `magic-nix-cache` to use. Conflicts with all other `source-*` options.
|
description: The PR of `magic-nix-cache` to use. Conflicts with all other `source-*` options.
|
||||||
required: false
|
required: false
|
||||||
default: 10
|
|
||||||
source-revision:
|
source-revision:
|
||||||
description: The revision of `nix-magic-nix-cache` to use. Conflicts with all other `source-*` options.
|
description: The revision of `nix-magic-nix-cache` to use. Conflicts with all other `source-*` options.
|
||||||
required: false
|
required: false
|
||||||
|
|
8
dist/index.js
generated
vendored
8
dist/index.js
generated
vendored
|
@ -12118,8 +12118,8 @@ const gotClient = got$1.extend({
|
||||||
function getCacherUrl() {
|
function getCacherUrl() {
|
||||||
const runnerArch = process.env.RUNNER_ARCH;
|
const runnerArch = process.env.RUNNER_ARCH;
|
||||||
const runnerOs = process.env.RUNNER_OS;
|
const runnerOs = process.env.RUNNER_OS;
|
||||||
const binarySuffix = `magic-nix-cache-${runnerArch}-${runnerOs}`;
|
const binarySuffix = `${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')) {
|
if (coreExports.getInput('source-url')) {
|
||||||
return coreExports.getInput('source-url');
|
return coreExports.getInput('source-url');
|
||||||
}
|
}
|
||||||
|
@ -12127,7 +12127,7 @@ function getCacherUrl() {
|
||||||
return `${urlPrefix}/tag/${coreExports.getInput('source-tag')}/${binarySuffix}`;
|
return `${urlPrefix}/tag/${coreExports.getInput('source-tag')}/${binarySuffix}`;
|
||||||
}
|
}
|
||||||
if (coreExports.getInput('source-pr')) {
|
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')) {
|
if (coreExports.getInput('source-branch')) {
|
||||||
return `${urlPrefix}/branch/${coreExports.getInput('source-branch')}/${binarySuffix}`;
|
return `${urlPrefix}/branch/${coreExports.getInput('source-branch')}/${binarySuffix}`;
|
||||||
|
@ -12140,7 +12140,7 @@ function getCacherUrl() {
|
||||||
async function fetchAutoCacher() {
|
async function fetchAutoCacher() {
|
||||||
const binary_url = getCacherUrl();
|
const binary_url = getCacherUrl();
|
||||||
coreExports.info(`Fetching the Magic Nix Cache from ${binary_url}`);
|
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);
|
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).
|
// 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);
|
const last_path = paths.at(-2);
|
||||||
|
|
|
@ -32,9 +32,8 @@ const gotClient = got.extend({
|
||||||
function getCacherUrl() : string {
|
function getCacherUrl() : string {
|
||||||
const runnerArch = process.env.RUNNER_ARCH;
|
const runnerArch = process.env.RUNNER_ARCH;
|
||||||
const runnerOs = process.env.RUNNER_OS;
|
const runnerOs = process.env.RUNNER_OS;
|
||||||
const binarySuffix = `magic-nix-cache-${runnerArch}-${runnerOs}`;
|
const binarySuffix = `${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')) {
|
if (core.getInput('source-url')) {
|
||||||
return core.getInput('source-url');
|
return core.getInput('source-url');
|
||||||
}
|
}
|
||||||
|
@ -44,7 +43,7 @@ function getCacherUrl() : string {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (core.getInput('source-pr')) {
|
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')) {
|
if (core.getInput('source-branch')) {
|
||||||
|
@ -62,7 +61,7 @@ async function fetchAutoCacher() {
|
||||||
const binary_url = getCacherUrl();
|
const binary_url = getCacherUrl();
|
||||||
core.info(`Fetching the Magic Nix Cache from ${binary_url}`);
|
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);
|
const paths = stdout.split(os.EOL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue