diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 01eb363..73e80e2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -116,6 +116,7 @@ jobs: } includes.push({ os: os, test: test, test_name: 'root', docker_install_type: 'archive', docker_install_version: 'v26.1.4' }); includes.push({ os: os, test: test, test_name: 'root', docker_install_type: 'archive', docker_install_version: 'latest' }); + includes.push({ os: os, test: test, test_name: 'root', docker_install_type: 'archive', docker_install_version: 'v29.0.0-rc.1', docker_install_channel: 'test' }); if (os === 'ubuntu-latest') { includes.push({ os: os, test: test, test_name: 'rootless', docker_install_type: 'image', docker_install_version: 'latest' }); includes.push({ os: os, test: test, test_name: 'rootless', docker_install_type: 'archive', docker_install_version: 'latest' }); @@ -208,6 +209,7 @@ jobs: TEST_FOR_SUMMARY: ${{ secrets.TEST_FOR_SUMMARY }} DOCKER_INSTALL_TYPE: ${{ matrix.docker_install_type }} DOCKER_INSTALL_VERSION: ${{ matrix.docker_install_version }} + DOCKER_INSTALL_CHANNEL: ${{ matrix.docker_install_channel }} - name: Check coverage run: | diff --git a/__tests__/docker/install.test.itg.ts b/__tests__/docker/install.test.itg.ts index e55353e..f724926 100644 --- a/__tests__/docker/install.test.itg.ts +++ b/__tests__/docker/install.test.itg.ts @@ -153,11 +153,12 @@ async function ensureNoSystemContainerd() { function getSources(root: boolean): Array { 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 { {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 diff --git a/__tests__/docker/install.test.ts b/__tests__/docker/install.test.ts index 3f14983..1f4e7de 100644 --- a/__tests__/docker/install.test.ts +++ b/__tests__/docker/install.test.ts @@ -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')); }); diff --git a/src/docker/install.ts b/src/docker/install.ts index e97c33d..9d7bfce 100644 --- a/src/docker/install.ts +++ b/src/docker/install.ts @@ -204,7 +204,7 @@ export class Install { private async downloadSourceArchive(component: 'docker' | 'docker-rootless-extras', src: InstallSourceArchive): Promise { const release: GitHubRelease = await Install.getRelease(src.version); - this._version = release.tag_name.replace(/^v+|v+$/g, ''); + this._version = release.tag_name.replace(/^(docker-)?v+/, ''); core.debug(`docker.Install.downloadSourceArchive version: ${this._version}`); const downloadURL = this.downloadURL(component, this._version, src.channel);