new: Prepare v1 release. (#9)

This commit is contained in:
Miles Johnson 2023-08-01 15:29:15 -07:00 committed by GitHub
parent 711a320c49
commit 889bf1db60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 592 additions and 450 deletions

View file

@ -1,7 +1,7 @@
import crypto from 'crypto';
import fs from 'fs';
import os from 'os';
import path from 'path';
import crypto from 'node:crypto';
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import * as cache from '@actions/cache';
import * as core from '@actions/core';
import * as exec from '@actions/exec';
@ -26,6 +26,9 @@ export async function downloadAndInstallBinstall(binDir: string) {
case 'x64':
arch = 'x86_64';
break;
case 'arm':
arch = 'armv7';
break;
case 'arm64':
arch = 'aarch64';
break;
@ -34,9 +37,21 @@ export async function downloadAndInstallBinstall(binDir: string) {
}
switch (process.platform) {
case 'linux':
file = `${arch}-unknown-linux-gnu.tgz`;
case 'linux': {
const { family } = await import('detect-libc');
let lib = 'gnu';
if ((await family()) === 'musl') {
lib = 'musl';
}
if (process.arch === 'arm') {
lib += 'eabihf';
}
file = `${arch}-unknown-linux-${lib}.tgz`;
break;
}
case 'darwin':
file = `${arch}-apple-darwin.zip`;
break;
@ -220,7 +235,7 @@ export async function restoreCache() {
core.saveState('cache-hit-key', cacheKey);
core.info(`Cache restored using key ${primaryKey}`);
} else {
core.warning(`Cache does not exist using key ${primaryKey}`);
core.info(`Cache does not exist using key ${primaryKey}`);
}
core.setOutput('cache-key', cacheKey ?? primaryKey);

View file

@ -1,7 +1,7 @@
/* eslint-disable import/no-mutable-exports */
import fs from 'fs';
import path from 'path';
import fs from 'node:fs';
import path from 'node:path';
import * as core from '@actions/core';
import * as exec from '@actions/exec';
import TOML from '@ltd/j-toml';