Skip to content

Commit dd7094e

Browse files
committed
ci: add workflow to build cross-compiler Docker image
1 parent 6630fa5 commit dd7094e

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Build Cross-Compiler Image
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
sdk_version:
7+
description: 'macOS SDK version'
8+
required: true
9+
default: '26.1'
10+
zig_version:
11+
description: 'Zig version'
12+
required: true
13+
default: '0.14.0'
14+
image_version:
15+
description: 'Image version tag'
16+
required: true
17+
default: '1.0.0'
18+
19+
env:
20+
REGISTRY: ghcr.io
21+
IMAGE_NAME: wailsapp/wails-cross
22+
23+
jobs:
24+
build:
25+
runs-on: ubuntu-latest
26+
permissions:
27+
contents: read
28+
packages: write
29+
30+
steps:
31+
- name: Checkout v3-alpha
32+
uses: actions/checkout@v4
33+
with:
34+
ref: v3-alpha
35+
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v3
38+
39+
- name: Log in to Container Registry
40+
uses: docker/login-action@v3
41+
with:
42+
registry: ${{ env.REGISTRY }}
43+
username: ${{ github.actor }}
44+
password: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Extract metadata
47+
id: meta
48+
uses: docker/metadata-action@v5
49+
with:
50+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
51+
tags: |
52+
type=raw,value=latest
53+
type=raw,value=${{ inputs.image_version }}
54+
type=raw,value=sdk-${{ inputs.sdk_version }}
55+
56+
- name: Build and push
57+
uses: docker/build-push-action@v5
58+
with:
59+
context: v3/internal/setupwizard/docker
60+
file: v3/internal/setupwizard/docker/Dockerfile.cross
61+
push: true
62+
tags: ${{ steps.meta.outputs.tags }}
63+
labels: ${{ steps.meta.outputs.labels }}
64+
build-args: |
65+
ZIG_VERSION=${{ inputs.zig_version }}
66+
MACOS_SDK_VERSION=${{ inputs.sdk_version }}
67+
IMAGE_VERSION=${{ inputs.image_version }}
68+
cache-from: type=gha
69+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)