Skip to content

Commit 45c4bed

Browse files
authored
Merge pull request #293 from crazy-max/v3_buildx-0.20.0
[v3] mark buildx >= 0.20.0 as incompatible with docker/bake-action < v5
2 parents f32f8b8 + aae765a commit 45c4bed

File tree

4 files changed

+59
-4
lines changed

4 files changed

+59
-4
lines changed

.github/workflows/ci.yml

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ on:
2222
pull_request:
2323

2424
env:
25-
BUILDX_VERSION: latest
25+
BUILDX_VERSION: v0.18.0
2626
BUILDKIT_IMAGE: moby/buildkit:buildx-stable-1
2727

2828
jobs:
@@ -72,6 +72,12 @@ jobs:
7272
-
7373
name: Checkout
7474
uses: actions/checkout@v3
75+
-
76+
name: Set up Docker Buildx
77+
uses: docker/setup-buildx-action@v3
78+
with:
79+
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
80+
driver: docker
7581
-
7682
name: Build
7783
continue-on-error: true
@@ -88,10 +94,16 @@ jobs:
8894
-
8995
name: Checkout
9096
uses: actions/checkout@v3
97+
-
98+
name: Set up Docker Buildx
99+
uses: docker/setup-buildx-action@v3
100+
with:
101+
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
102+
driver: docker
91103
-
92104
name: Stop docker
93105
run: |
94-
sudo systemctl stop docker
106+
sudo systemctl stop docker docker.socket
95107
-
96108
name: Build
97109
id: bake
@@ -139,6 +151,12 @@ jobs:
139151
-
140152
name: Checkout
141153
uses: actions/checkout@v3
154+
-
155+
name: Set up Docker Buildx
156+
uses: docker/setup-buildx-action@v3
157+
with:
158+
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
159+
driver: docker
142160
-
143161
name: Build
144162
uses: ./
@@ -256,6 +274,12 @@ jobs:
256274
-
257275
name: Checkout
258276
uses: actions/checkout@v3
277+
-
278+
name: Set up Docker Buildx
279+
uses: docker/setup-buildx-action@v3
280+
with:
281+
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
282+
driver: docker
259283
-
260284
name: Build
261285
uses: ./
@@ -294,3 +318,31 @@ jobs:
294318
set: |
295319
t1.tags=localhost:5000/name/app:t1
296320
t2.tags=localhost:5000/name/app:t2
321+
322+
error-buildx-latest:
323+
runs-on: ubuntu-latest
324+
steps:
325+
-
326+
name: Checkout
327+
uses: actions/checkout@v3
328+
-
329+
name: Set up Docker Buildx
330+
uses: docker/setup-buildx-action@v2
331+
with:
332+
version: v0.20.0
333+
-
334+
name: Build
335+
id: bake
336+
continue-on-error: true
337+
uses: ./
338+
with:
339+
files: |
340+
./test/config.hcl
341+
-
342+
name: Check
343+
run: |
344+
echo "${{ toJson(steps.bake) }}"
345+
if [ "${{ steps.bake.outcome }}" != "failure" ] || [ "${{ steps.bake.conclusion }}" != "success" ]; then
346+
echo "::error::Should have failed"
347+
exit 1
348+
fi

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ actionsToolkit.run(
1616
async () => {
1717
const inputs: context.Inputs = await context.getInputs();
1818
const toolkit = new Toolkit();
19+
if (await toolkit.buildx.versionSatisfies('>=0.20.0')) {
20+
throw new Error('docker/bake-action < v5 is not compatible with buildx >= 0.20.0, please update your workflow to latest docker/bake-action or use an older buildx version.');
21+
}
1922

2023
await core.group(`GitHub Actions runtime token ACs`, async () => {
2124
try {

0 commit comments

Comments
 (0)