diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b33572..9f2a3c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 1.2.1 + +- Pinned the `cargo-binstall` version to v1.8 to work around the 404 errors in CI. +- Added support for the `CARGO_BINSTALL_VERSION` environment variable. + # 1.2.0 - Added a `target-dirs` input, allowing the target folders to be specified. Can now cache multiple diff --git a/package.json b/package.json index c1ecad7..eda9099 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moonrepo/setup-rust", - "version": "1.2.0", + "version": "1.2.1", "description": "A GitHub action for setting up Rust and Cargo.", "main": "dist/index.js", "scripts": { diff --git a/src/cargo.ts b/src/cargo.ts index 0b8c60c..dfca963 100644 --- a/src/cargo.ts +++ b/src/cargo.ts @@ -17,6 +17,7 @@ import { } from './cache'; import { rmrf } from './fs'; +// eslint-disable-next-line complexity export async function downloadAndInstallBinstall(binDir: string) { core.info('cargo-binstall does not exist, attempting to install'); @@ -62,7 +63,11 @@ export async function downloadAndInstallBinstall(binDir: string) { throw new Error(`Unsupported platform: ${process.platform}`); } - const url = `https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-${file}`; + // https://github.com/cargo-bins/cargo-binstall/issues/1864 + const version = process.env.CARGO_BINSTALL_VERSION ?? 'v1.8.0'; + const url = version === 'latest' + ? `https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-${file}` + : `https://github.com/cargo-bins/cargo-binstall/releases/download/${version}/cargo-binstall-${file}`; const dlPath = await tc.downloadTool(url); if (url.endsWith('.zip')) {