diff --git a/CHANGELOG.md b/CHANGELOG.md index e32eb87f..184cff10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,16 @@ + +## v3.0.3 (2022-10-18) + +#### :bug: Bug Fix +* [#118](https://github.com/volta-cli/action/pull/118) [BACKPORT] Add volta@1.1.0 support to v3.x releases. ([@rwjblue](https://github.com/rwjblue)) + +#### Committers: 1 +- Robert Jackson ([@rwjblue](https://github.com/rwjblue)) + + ## v3.0.2 (2022-09-01) #### :bug: Bug Fix diff --git a/dist/index.js b/dist/index.js index 6e0c596c..ffe1608e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -22674,22 +22674,41 @@ async function getLatestVolta(authToken) { function voltaVersionHasSetup(version) { return semver.gte(version, '0.7.0'); } -async function buildDownloadUrl(platform, version, openSSLVersion = '') { +async function buildDownloadUrl(platform, arch, version, openSSLVersion = '') { let fileName; - switch (platform) { - case 'darwin': - fileName = `volta-${version}-macos.tar.gz`; - break; - case 'linux': { - openSSLVersion = await getOpenSSLVersion(openSSLVersion); - fileName = `volta-${version}-linux-${openSSLVersion}.tar.gz`; - break; + const isOpenSSLDependent = semver.lt(version, '1.1.0'); + if (isOpenSSLDependent) { + switch (platform) { + case 'darwin': + fileName = `volta-${version}-macos.tar.gz`; + break; + case 'linux': { + openSSLVersion = await getOpenSSLVersion(openSSLVersion); + fileName = `volta-${version}-linux-${openSSLVersion}.tar.gz`; + break; + } + case 'win32': + fileName = `volta-${version}-windows-x86_64.msi`; + break; + default: + throw new Error(`your platform ${platform} is not yet supported`); + } + } + else { + switch (platform) { + case 'darwin': + fileName = `volta-${version}-macos${arch === 'arm64' ? '-aarch64' : ''}.tar.gz`; + break; + case 'linux': { + fileName = `volta-${version}-linux.tar.gz`; + break; + } + case 'win32': + fileName = `volta-${version}-windows-x86_64.msi`; + break; + default: + throw new Error(`your platform ${platform} is not yet supported`); } - case 'win32': - fileName = `volta-${version}-windows-x86_64.msi`; - break; - default: - throw new Error(`your platform ${platform} is not yet supported`); } return `https://github.com/volta-cli/volta/releases/download/v${version}/${fileName}`; } @@ -22773,7 +22792,7 @@ async function acquireVolta(version, authToken, openSSLVersion) { // Download - a tool installer intimately knows how to get the tool (and construct urls) // core.info(`downloading volta@${version}`); - const downloadUrl = await buildDownloadUrl(external_os_.platform(), version, openSSLVersion); + const downloadUrl = await buildDownloadUrl(external_os_.platform(), external_os_.arch(), version, openSSLVersion); core.debug(`downloading from \`${downloadUrl}\``); const downloadPath = await tool_cache.downloadTool(downloadUrl, undefined, authToken); const voltaHome = external_path_.join( diff --git a/package-lock.json b/package-lock.json index df0f37d8..38b76324 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@volta-cli/action", - "version": "3.0.2", + "version": "3.0.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@volta-cli/action", - "version": "3.0.2", + "version": "3.0.3", "license": "MIT", "devDependencies": { "@actions/core": "^1.9.1", diff --git a/package.json b/package.json index 59a22ec5..3ac7adbe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@volta-cli/action", - "version": "3.0.2", + "version": "3.0.3", "private": true, "description": "Setup volta for usage in your CI runs", "keywords": [