Skip to content

Commit 5d39f1a

Browse files
leaanthonyclaude
andcommitted
ci: fix cross-compiler workflow for multi-arch builds
- Fix Dockerfile path (was pointing to non-existent setupwizard/docker) - Add multi-platform build (linux/amd64 + linux/arm64) - Add QEMU for ARM64 cross-compilation - Add automatic trigger on Dockerfile.cross changes to v3-alpha - Update SDK version default to 14.5 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent a279959 commit 5d39f1a

1 file changed

Lines changed: 29 additions & 11 deletions

File tree

.github/workflows/build-cross-image.yml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,20 @@ on:
1010
sdk_version:
1111
description: 'macOS SDK version'
1212
required: true
13-
default: '26.1'
13+
default: '14.5'
1414
zig_version:
1515
description: 'Zig version'
1616
required: true
1717
default: '0.14.0'
1818
image_version:
1919
description: 'Image version tag'
2020
required: true
21-
default: '1.0.0'
21+
default: 'latest'
22+
push:
23+
branches:
24+
- v3-alpha
25+
paths:
26+
- 'v3/internal/commands/build_assets/docker/Dockerfile.cross'
2227

2328
env:
2429
REGISTRY: ghcr.io
@@ -35,7 +40,10 @@ jobs:
3540
- name: Checkout
3641
uses: actions/checkout@v4
3742
with:
38-
ref: ${{ inputs.branch }}
43+
ref: ${{ inputs.branch || github.ref }}
44+
45+
- name: Set up QEMU
46+
uses: docker/setup-qemu-action@v3
3947

4048
- name: Set up Docker Buildx
4149
uses: docker/setup-buildx-action@v3
@@ -47,27 +55,37 @@ jobs:
4755
username: ${{ github.actor }}
4856
password: ${{ secrets.GITHUB_TOKEN }}
4957

58+
- name: Set build variables
59+
id: vars
60+
run: |
61+
echo "sdk_version=${{ inputs.sdk_version || '14.5' }}" >> $GITHUB_OUTPUT
62+
echo "zig_version=${{ inputs.zig_version || '0.14.0' }}" >> $GITHUB_OUTPUT
63+
echo "image_version=${{ inputs.image_version || 'latest' }}" >> $GITHUB_OUTPUT
64+
5065
- name: Extract metadata
5166
id: meta
5267
uses: docker/metadata-action@v5
5368
with:
5469
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
5570
tags: |
5671
type=raw,value=latest
57-
type=raw,value=${{ inputs.image_version }}
58-
type=raw,value=sdk-${{ inputs.sdk_version }}
72+
type=raw,value=${{ steps.vars.outputs.image_version }}
73+
type=raw,value=sdk-${{ steps.vars.outputs.sdk_version }}
5974
6075
- name: Build and push
6176
uses: docker/build-push-action@v5
6277
with:
63-
context: v3/internal/setupwizard/docker
64-
file: v3/internal/setupwizard/docker/Dockerfile.cross
78+
context: v3/internal/commands/build_assets/docker
79+
file: v3/internal/commands/build_assets/docker/Dockerfile.cross
80+
platforms: linux/amd64,linux/arm64
6581
push: true
6682
tags: ${{ steps.meta.outputs.tags }}
67-
labels: ${{ steps.meta.outputs.labels }}
83+
labels: |
84+
${{ steps.meta.outputs.labels }}
85+
io.wails.zig.version=${{ steps.vars.outputs.zig_version }}
86+
io.wails.sdk.version=${{ steps.vars.outputs.sdk_version }}
6887
build-args: |
69-
ZIG_VERSION=${{ inputs.zig_version }}
70-
MACOS_SDK_VERSION=${{ inputs.sdk_version }}
71-
IMAGE_VERSION=${{ inputs.image_version }}
88+
ZIG_VERSION=${{ steps.vars.outputs.zig_version }}
89+
MACOS_SDK_VERSION=${{ steps.vars.outputs.sdk_version }}
7290
cache-from: type=gha
7391
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)