Skip to content

Commit 7ac5cd3

Browse files
committed
setup regctl and undock
1 parent b7bb1d4 commit 7ac5cd3

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,3 +305,25 @@ jobs:
305305
docker info
306306
env:
307307
DOCKER_HOST: ${{ steps.setup_docker.outputs.tcp }}
308+
309+
undock-regctl-version:
310+
runs-on: ubuntu-latest
311+
strategy:
312+
fail-fast: false
313+
matrix:
314+
undock_version:
315+
- ''
316+
- v0.9.0
317+
regctl_version:
318+
- ''
319+
- v0.8.2
320+
steps:
321+
-
322+
name: Checkout
323+
uses: actions/checkout@v4
324+
-
325+
name: Set up Docker
326+
uses: ./
327+
env:
328+
UNDOCK_VERSION: ${{ matrix.undock_version }}
329+
REGCTL_VERSION: ${{ matrix.regctl_version }}

src/main.ts

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import * as core from '@actions/core';
55
import * as actionsToolkit from '@docker/actions-toolkit';
66
import {Install} from '@docker/actions-toolkit/lib/docker/install';
77
import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
8+
import {Install as RegclientInstall} from '@docker/actions-toolkit/lib/regclient/install';
9+
import {Regctl} from '@docker/actions-toolkit/lib/regclient/regctl';
10+
import {Install as UndockInstall} from '@docker/actions-toolkit/lib/undock/install';
11+
import {Undock} from '@docker/actions-toolkit/lib/undock/undock';
812

913
import * as context from './context';
1014
import * as stateHelper from './state-helper';
@@ -19,6 +23,22 @@ actionsToolkit.run(
1923
throw new Error(`'default' context cannot be used.`);
2024
}
2125

26+
await core.group(`Download and install regctl`, async () => {
27+
const regclientInstall = new RegclientInstall();
28+
const regclientBinPath = await regclientInstall.download(
29+
process.env.REGCTL_VERSION && process.env.REGCTL_VERSION.trim() ? process.env.REGCTL_VERSION : 'v0.8.3'
30+
);
31+
await regclientInstall.install(regclientBinPath);
32+
});
33+
34+
await core.group(`Download and install undock`, async () => {
35+
const undockInstall = new UndockInstall();
36+
const undockBinPath = await undockInstall.download(
37+
process.env.UNDOCK_VERSION && process.env.UNDOCK_VERSION.trim() ? process.env.UNDOCK_VERSION : 'v0.10.0'
38+
);
39+
await undockInstall.install(undockBinPath);
40+
});
41+
2242
let tcpPort: number | undefined;
2343
let tcpAddress: string | undefined;
2444
if (input.tcpPort) {
@@ -32,7 +52,9 @@ actionsToolkit.run(
3252
rootless: input.rootless,
3353
contextName: input.context || 'setup-docker-action',
3454
daemonConfig: input.daemonConfig,
35-
localTCPPort: tcpPort
55+
localTCPPort: tcpPort,
56+
regctl: new Regctl(),
57+
undock: new Undock()
3658
});
3759
let toolDir;
3860
if (!(await Docker.isAvailable()) || input.source) {
@@ -71,7 +93,9 @@ actionsToolkit.run(
7193
return;
7294
}
7395
const install = new Install({
74-
runDir: stateHelper.runDir
96+
runDir: stateHelper.runDir,
97+
regctl: new Regctl(),
98+
undock: new Undock()
7599
});
76100
await install.tearDown();
77101
}

0 commit comments

Comments
 (0)