docker(install): fix source archive version

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2025-10-15 12:24:09 +02:00
parent 73904748dc
commit 0c5ce444d7
4 changed files with 17 additions and 4 deletions

View File

@@ -153,11 +153,12 @@ async function ensureNoSystemContainerd() {
function getSources(root: boolean): Array<InstallSource> {
const dockerInstallType = process.env.DOCKER_INSTALL_TYPE;
const dockerInstallVersion = process.env.DOCKER_INSTALL_VERSION;
const dockerInstallChannel = process.env.DOCKER_INSTALL_CHANNEL || 'stable';
if (dockerInstallType && dockerInstallVersion) {
if (dockerInstallType === 'archive') {
// prettier-ignore
return [
{ type: dockerInstallType, version: dockerInstallVersion, channel: 'stable'} as InstallSourceArchive
{ type: dockerInstallType, version: dockerInstallVersion, channel: dockerInstallChannel} as InstallSourceArchive
];
} else {
// prettier-ignore
@@ -173,7 +174,8 @@ function getSources(root: boolean): Array<InstallSource> {
{type: 'image', tag: 'master'} as InstallSourceImage,
{type: 'image', tag: 'latest'} as InstallSourceImage,
{type: 'archive', version: 'v26.1.4', channel: 'stable'} as InstallSourceArchive,
{type: 'archive', version: 'latest', channel: 'stable'} as InstallSourceArchive
{type: 'archive', version: 'latest', channel: 'stable'} as InstallSourceArchive,
{type: 'archive', version: 'v29.0.0-rc.1', channel: 'test'} as InstallSourceArchive
];
} else {
// prettier-ignore

View File

@@ -53,6 +53,7 @@ describe('download', () => {
[archive('v20.10.22', 'stable'), 'linux'],
[archive('v20.10.22', 'stable'), 'darwin'],
[archive('v20.10.22', 'stable'), 'win32'],
[archive('v29.0.0-rc.1', 'test'), 'linux'],
[image('master'), 'linux'],
[image('master'), 'win32'],
@@ -81,7 +82,7 @@ describe('getRelease', () => {
expect(release?.tag_name).not.toEqual('');
});
it('returns v23.0.0 buildx GitHub release', async () => {
it('returns v23.0.0 docker GitHub release', async () => {
const release = await Install.getRelease('v23.0.0');
expect(release).not.toBeNull();
expect(release?.id).toEqual(91109643);
@@ -89,6 +90,14 @@ describe('getRelease', () => {
expect(release?.html_url).toEqual('https://github.com/moby/moby/releases/tag/v23.0.0');
});
it('returns v29.0.0-rc.1 docker GitHub release', async () => {
const release = await Install.getRelease('v29.0.0-rc.1');
expect(release).not.toBeNull();
expect(release?.id).toEqual(252020476);
expect(release?.tag_name).toEqual('docker-v29.0.0-rc.1');
expect(release?.html_url).toEqual('https://github.com/moby/moby/releases/tag/docker-v29.0.0-rc.1');
});
it('unknown release', async () => {
await expect(Install.getRelease('foo')).rejects.toThrow(new Error('Cannot find Docker release foo in https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/docker-releases.json'));
});