Skip to content

Commit a5e562f

Browse files
committed
updated version
1 parent 2f1140a commit a5e562f

1 file changed

Lines changed: 39 additions & 10 deletions

File tree

index.js

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,56 @@ const io = require('@actions/io');
88

99
const urls = {
1010
'linux': 'https://releases.stackql.io/stackql/latest/stackql_linux_amd64.zip',
11-
'darwin': 'https://storage.googleapis.com/stackql-public-releases/latest/stackql_darwin_multiarch.pkg',
11+
// 'darwin': 'https://storage.googleapis.com/stackql-public-releases/latest/stackql_darwin_multiarch.pkg',
1212
'win32': 'https://releases.stackql.io/stackql/latest/stackql_windows_amd64.zip',
1313
}
1414

15+
// async function downloadCLI(osPlatform){
16+
// try {
17+
18+
// core.info(`downloading stackql binary for ${osPlatform}`);
19+
// const url = urls[osPlatform]
20+
// core.debug(`binary location: ${url}`);
21+
22+
// switch (osPlatform) {
23+
// case 'win32':
24+
// return await tc.extractZip(await tc.downloadTool(url));
25+
// case 'darwin':
26+
// let tmpPath = await tc.downloadTool(url);
27+
// core.info(`extracting mac pkg in ${tmpPath}...`);
28+
// const installPath = '/Users/runner/work/_temp/stackql-pkg';
29+
// execSync(`pkgutil --expand-full ${tmpPath} ${installPath}`);
30+
// return `${installPath}/Payload`;
31+
// case 'linux':
32+
// return await tc.extractZip(await tc.downloadTool(url));
33+
// default:
34+
// throw new Error(`Unsupported platform: ${osPlatform}`);
35+
// }
36+
37+
// } catch (error) {
38+
// core.error(error);
39+
// throw error;
40+
// }
41+
// }
42+
1543
async function downloadCLI(osPlatform){
1644
try {
1745

1846
core.info(`downloading stackql binary for ${osPlatform}`);
19-
const url = urls[osPlatform]
20-
core.debug(`binary location: ${url}`);
47+
// const url = urls[osPlatform];
48+
// core.debug(`binary location: ${url}`);
2149

2250
switch (osPlatform) {
2351
case 'win32':
24-
return await tc.extractZip(await tc.downloadTool(url));
52+
return await tc.extractZip(await tc.downloadTool(urls[osPlatform]));
2553
case 'darwin':
26-
let tmpPath = await tc.downloadTool(url);
27-
core.info(`extracting mac pkg in ${tmpPath}...`);
28-
const installPath = '/Users/runner/work/_temp/stackql-pkg';
29-
execSync(`pkgutil --expand-full ${tmpPath} ${installPath}`);
30-
return `${installPath}/Payload`;
54+
core.info(`installing stackql using Homebrew`);
55+
execSync('brew install stackql', { stdio: 'inherit' });
56+
// Assuming stackql installs to a standard location accessible in the PATH
57+
// No need to return a path since brew handles placing it in the PATH
58+
return '/usr/local/bin'; // or wherever brew installs binaries
3159
case 'linux':
32-
return await tc.extractZip(await tc.downloadTool(url));
60+
return await tc.extractZip(await tc.downloadTool(urls[osPlatform]));
3361
default:
3462
throw new Error(`Unsupported platform: ${osPlatform}`);
3563
}
@@ -40,6 +68,7 @@ async function downloadCLI(osPlatform){
4068
}
4169
}
4270

71+
4372
async function makeExecutable(cliPath, osPlatform){
4473
try {
4574
if(osPlatform === 'win32'){

0 commit comments

Comments
 (0)