use Octokit client to download buildx

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2023-01-28 01:43:10 +01:00
parent c252a3bb80
commit 7c965aebec
12 changed files with 200 additions and 18 deletions

View File

@@ -237,10 +237,12 @@ export async function build(inputBuildRef: string, dest: string, standalone: boo
return setPlugin(toolPath, dest);
}
export async function install(inputVersion: string, dest: string, standalone: boolean): Promise<string> {
const release: github.GitHubRelease | null = await github.getRelease(inputVersion);
if (!release) {
throw new Error(`Cannot find buildx ${inputVersion} release`);
export async function install(inputVersion: string, githubToken: string, dest: string, standalone: boolean): Promise<string> {
let release: github.Release;
if (inputVersion == 'latest') {
release = await github.getLatestRelease(githubToken);
} else {
release = await github.getReleaseTag(inputVersion, githubToken);
}
core.debug(`Release ${release.tag_name} found`);
const version = release.tag_name.replace(/^v+|v+$/g, '');