@@ -6,6 +6,7 @@ const os = require('os');
6
6
const name = 'aliyun' ;
7
7
const platform = os . platform ( ) ;
8
8
const version = core . getInput ( 'aliyun-cli-version' , { required : true } ) ;
9
+ const arch = getArch ( os . arch ( ) ) ;
9
10
10
11
const configs = [
11
12
{ input : 'mode' , flag : '--mode' } ,
@@ -21,6 +22,26 @@ for (const config of configs) {
21
22
config . value = core . getInput ( config . input ) ;
22
23
}
23
24
25
+ function getArch ( arch ) {
26
+ // 'arm', 'arm64', 'ia32', 'mips', 'mipsel', 'ppc', 'ppc64', 's390', 's390x', 'x32', and 'x64'.
27
+
28
+ // wants amd64, 386, arm64, armv61, ppc641e, s390x
29
+ // currently not supported by runner but future proofed mapping
30
+ switch ( arch ) {
31
+ case 'x64' :
32
+ arch = 'amd64' ;
33
+ break ;
34
+ case 'x32' :
35
+ arch = '386' ;
36
+ break ;
37
+ case 'arm' :
38
+ arch = 'armv6l' ;
39
+ break ;
40
+ }
41
+
42
+ return arch ;
43
+ }
44
+
24
45
async function run ( ) {
25
46
const [ system , ext , extractFunc , executable ] = ( function ( ) { switch ( platform ) {
26
47
case 'linux' :
@@ -33,7 +54,7 @@ async function run() {
33
54
throw new Error ( `Unexpected OS ${ platform } ` ) ;
34
55
} } ) ( ) ;
35
56
36
- const url = `https://github.com/aliyun/aliyun-cli/releases/download/v${ version } /aliyun-cli-${ system } -${ version } -amd64 .${ ext } ` ;
57
+ const url = `https://github.com/aliyun/aliyun-cli/releases/download/v${ version } /aliyun-cli-${ system } -${ version } -${ arch } .${ ext } ` ;
37
58
const downloadedPath = await tc . downloadTool ( url ) ;
38
59
const extractedPath = await tc [ extractFunc ] ( downloadedPath ) ;
39
60
const cachedPath = await tc . cacheDir ( extractedPath , name , version ) ;
0 commit comments