This repository was archived by the owner on Jul 3, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,28 @@ const core = require("@actions/core");
2
2
const tc = require ( "@actions/tool-cache" ) ;
3
3
4
4
( async ( ) => {
5
- const url =
6
- "https://github.com/koki-develop/qiita-cli/releases/download/v0.1.0/qiita_Linux_x86_64.tar.gz" ;
5
+ const version = ( ( ) => {
6
+ const version = "0.1.0" ; // TODO: get from input
7
+ if ( ! version . startsWith ( "v" ) ) {
8
+ return `v${ version } ` ;
9
+ }
10
+ } ) ( ) ;
11
+ core . info ( `version: ${ version } ` ) ;
12
+
13
+ const platform = process . platform ;
14
+ const arch = process . arch ;
15
+ core . info ( `platform: ${ platform } ` ) ;
16
+ core . info ( `arch: ${ arch } ` ) ;
17
+
18
+ core . info ( "Downloading..." ) ;
19
+ const url = `https://github.com/koki-develop/qiita-cli/releases/download/${ version } /qiita_Linux_x86_64.tar.gz` ;
7
20
const cliPath = await tc . downloadTool ( url ) ;
21
+
22
+ core . info ( "Installing..." ) ;
8
23
const extractedPath = await tc . extractTar ( cliPath ) ;
9
24
const binPath = await tc . cacheDir ( extractedPath , "qiita" , "0.1.0" ) ;
10
25
core . addPath ( binPath ) ;
26
+ core . info ( "Installed." ) ;
11
27
} ) ( ) . catch ( ( err ) => {
12
28
core . setFailed ( err . message ) ;
13
29
} ) ;
You can’t perform that action at this time.
0 commit comments