Skip to content

Commit

Permalink
Fix the missing binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanSiu1995 committed Aug 17, 2020
1 parent 55bb933 commit 1f4d99c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ jobs:
echo "All binaries from kubebuilder have been installed!"
else
echo "Cannot find the binaries from kubuilder!"
ls -la ./
exit 1
fi
13 changes: 6 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ async function run() {

core.info(`Going to install kubebuilder ${version} for ${osPlat}-${osArch}`);

await child_process.exec('sudo mkdir -p /usr/local/kubebuilder/bin/')

const downloadUrl = `https://go.kubebuilder.io/dl/${version}/${osPlat}/${osArch}`;
const downloadPath = await tc.downloadTool(downloadUrl, undefined, undefined);

const extPath = await tc.extractTar(downloadPath);

await child_process.exec(`sudo cp ${extPath}/bin/ /usr/local/kubebuilder/bin/`)
child_process.execSync(`curl -L ${downloadUrl} | tar -xz -C /tmp/`, { shell: '/bin/bash'})
child_process.execSync(`sudo mv /tmp/kubebuilder_${version}_${osPlat}_${osArch}/ /usr/local/kubebuilder/`, { shell: '/bin/bash'})
child_process.execSync(`ls -la /usr/local/kubebuilder/bin`, { shell: '/bin/bash'})

const cachedPath = await tc.cacheDir('/usr/local/kubebuilder', 'kubebuildrr', version);
core.addPath(cachedPath);
} catch (error) {
core.setFailed(error.message);
}
Expand Down

0 comments on commit 1f4d99c

Please sign in to comment.