mirror of
https://github.com/moonrepo/setup-rust.git
synced 2025-04-29 21:40:01 +00:00
new: Prepare v1 release. (#9)
This commit is contained in:
parent
711a320c49
commit
889bf1db60
9 changed files with 592 additions and 450 deletions
29
src/cargo.ts
29
src/cargo.ts
|
@ -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);
|
||||
|
|
|
@ -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';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue