@@ -4,15 +4,27 @@ import * as os from 'os'
44import * as path from 'path'
55import * as tc from '@actions/tool-cache'
66
7- const csVersion = core . getInput ( 'version' ) || '2.1.2'
7+ const defaultVersion_x86_64 = '2.1.2'
8+ const defaultVersion_aarch64 = '2.1.1'
89
10+ const architecture_x86_64 = 'x86_64'
11+ const architecture_aarch64 = 'aarch64'
12+
13+ const architecture = getCoursierArchitecture ( )
14+ const csVersion = core . getInput ( 'version' ) || ( architecture === architecture_x86_64
15+ ? defaultVersion_x86_64
16+ : defaultVersion_aarch64
17+ )
918const coursierVersionSpec = csVersion
19+ const coursierBinariesGithubRepository = ( architecture === architecture_x86_64 )
20+ ? 'https://github.com/coursier/coursier/'
21+ : 'https://github.com/VirtusLab/coursier-m1/'
1022
1123function getCoursierArchitecture ( ) : string {
1224 if ( process . arch === 'x64' ) {
13- return 'x86_64'
25+ return architecture_x86_64
1426 } else if ( process . arch === 'arm' || process . arch === 'arm64' ) {
15- return 'aarch64'
27+ return architecture_aarch64
1628 } else {
1729 throw new Error ( `Coursier does not have support for the ${ process . arch } architecture` )
1830 }
@@ -32,8 +44,7 @@ async function execOutput(cmd: string, ...args: string[]): Promise<string> {
3244}
3345
3446async function downloadCoursier ( ) : Promise < string > {
35- const architecture = getCoursierArchitecture ( )
36- const baseUrl = `https://github.com/coursier/coursier/releases/download/v${ csVersion } /cs-${ architecture } `
47+ const baseUrl = `${ coursierBinariesGithubRepository } /releases/download/v${ csVersion } /cs-${ architecture } `
3748 let csBinary = ''
3849 switch ( process . platform ) {
3950 case 'linux' : {
0 commit comments