Skip to content

Commit 7d5ed41

Browse files
authored
Merge pull request #22 from crazy-max/fix-buildx-install
buildx: use correct url for getRelease
2 parents 63427f8 + 87a4161 commit 7d5ed41

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

__tests__/buildx/install.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,6 @@ describe('getRelease', () => {
9797
});
9898

9999
it('unknown release', async () => {
100-
await expect(Install.getRelease('foo')).rejects.toThrowError(new Error('Cannot find Buildx release foo in https://raw.githubusercontent.com/docker/buildx/master/.github/releases.json'));
100+
await expect(Install.getRelease('foo')).rejects.toThrowError(new Error('Cannot find Buildx release foo in https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/buildx-releases.json'));
101101
});
102102
});

src/buildx/install.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class Install {
5454
return this.setPlugin(toolPath, dest);
5555
}
5656

57-
public async setStandalone(toolPath: string, dest: string): Promise<string> {
57+
private async setStandalone(toolPath: string, dest: string): Promise<string> {
5858
const toolBinPath = path.join(toolPath, os.platform() == 'win32' ? 'docker-buildx.exe' : 'docker-buildx');
5959
const binDir = path.join(dest, 'bin');
6060
if (!fs.existsSync(binDir)) {
@@ -68,7 +68,7 @@ export class Install {
6868
return buildxPath;
6969
}
7070

71-
public async setPlugin(toolPath: string, dest: string): Promise<string> {
71+
private async setPlugin(toolPath: string, dest: string): Promise<string> {
7272
const toolBinPath = path.join(toolPath, os.platform() == 'win32' ? 'docker-buildx.exe' : 'docker-buildx');
7373
const pluginsDir: string = path.join(dest, 'cli-plugins');
7474
if (!fs.existsSync(pluginsDir)) {
@@ -124,8 +124,7 @@ export class Install {
124124
}
125125

126126
public static async getRelease(version: string): Promise<GitHubRelease> {
127-
// FIXME: Use https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/buildx-releases.json when repo public
128-
const url = `https://raw.githubusercontent.com/docker/buildx/master/.github/releases.json`;
127+
const url = `https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/buildx-releases.json`;
129128
const http: httpm.HttpClient = new httpm.HttpClient('docker-actions-toolkit');
130129
const resp: httpm.HttpClientResponse = await http.get(url);
131130
const body = await resp.readBody();

0 commit comments

Comments
 (0)