feat: introduce custom wails-builder Docker image to optimize CI build speed and consistency
Build and Upload Binaries / build-and-upload (push) Successful in 7m49s
Build and Upload Binaries / build-and-upload (push) Successful in 7m49s
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
name: Build Docker Image
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-and-push-image:
|
||||
runs-on: build-htz-01
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile.build
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: cr.jdbnet.co.uk/jdbnet/wails-builder:latest
|
||||
@@ -21,16 +21,9 @@ jobs:
|
||||
mkdir -p dist
|
||||
|
||||
# Build Linux amd64 and Windows (amd64 & arm64) binaries
|
||||
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace golang:1.26.4-bookworm bash -c "
|
||||
apt-get update && apt-get install -y curl gcc mingw-w64 libgtk-3-dev libwebkit2gtk-4.1-dev
|
||||
|
||||
# Install Node.js
|
||||
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
|
||||
apt-get install -y nodejs
|
||||
|
||||
# Install Wails CLI
|
||||
go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
||||
export PATH=\"\$PATH:\$(go env GOPATH)/bin\"
|
||||
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace cr.jdbnet.co.uk/jdbnet/wails-builder:latest bash -c "
|
||||
# Install frontend dependencies
|
||||
cd frontend && npm install && cd ..
|
||||
|
||||
# Linux amd64
|
||||
wails build -platform linux/amd64 -tags webkit2_41 -clean
|
||||
@@ -48,24 +41,14 @@ jobs:
|
||||
- name: Build Linux ARM64 binary (via QEMU)
|
||||
run: |
|
||||
# Build Linux arm64 binaries (via QEMU)
|
||||
docker run --rm --platform linux/arm64 -v ${{ github.workspace }}:/workspace -w /workspace golang:1.26.4-bookworm bash -c "
|
||||
apt-get update && apt-get install -y curl gcc libgtk-3-dev libwebkit2gtk-4.1-dev
|
||||
|
||||
# Install Node.js
|
||||
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
|
||||
apt-get install -y nodejs
|
||||
|
||||
docker run --rm --platform linux/arm64 -v ${{ github.workspace }}:/workspace -w /workspace cr.jdbnet.co.uk/jdbnet/wails-builder:latest bash -c "
|
||||
# Re-install frontend dependencies for arm64 (clears out the amd64 esbuild binary)
|
||||
rm -rf frontend/node_modules
|
||||
cd frontend && npm install && cd ..
|
||||
|
||||
# Install Wails CLI
|
||||
go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
||||
export PATH=\"\$PATH:\$(go env GOPATH)/bin\"
|
||||
|
||||
# Linux arm64
|
||||
wails build -platform linux/arm64 -tags webkit2_41 -clean
|
||||
cp build/bin/goexplore-init dist/goexplore-linux-arm64
|
||||
cp build/bin/goexplore dist/goexplore-linux-arm64
|
||||
"
|
||||
|
||||
- name: Upload to Cloudflare R2
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
FROM golang:1.26.4-bookworm
|
||||
|
||||
# Install required system dependencies for Wails, GTK, WebKit, and MinGW for cross-compiling
|
||||
RUN apt-get update && apt-get install -y \
|
||||
curl \
|
||||
gcc \
|
||||
mingw-w64 \
|
||||
libgtk-3-dev \
|
||||
libwebkit2gtk-4.1-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Node.js 22
|
||||
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
|
||||
&& apt-get install -y nodejs \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Wails CLI
|
||||
RUN go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
||||
|
||||
ENV PATH="$PATH:/go/bin"
|
||||
|
||||
WORKDIR /workspace
|
||||
Reference in New Issue
Block a user