From a751e7335b6beefcb6852185060b61064426322a Mon Sep 17 00:00:00 2001 From: lyingbug Date: Sat, 11 Apr 2026 22:28:25 +0800 Subject: [PATCH] fix windows build --- .github/workflows/release-lite.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-lite.yml b/.github/workflows/release-lite.yml index c5f434a3d..3b384ade0 100644 --- a/.github/workflows/release-lite.yml +++ b/.github/workflows/release-lite.yml @@ -201,10 +201,21 @@ jobs: fi echo "version=${VERSION}" >> "$GITHUB_OUTPUT" + - name: Pre-compile Go packages (Windows) + if: runner.os == 'Windows' + shell: bash + run: | + export GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn + export CGO_CFLAGS="-Wno-deprecated-declarations" + cd cmd/desktop + go build -p 1 -buildvcs=false -tags "desktop,sqlite_fts5,production" -o _prebuild_tmp.exe . || true + rm -f _prebuild_tmp.exe + - name: Build desktop app shell: bash run: | export EDITION=lite + export GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn eval "$(./scripts/get_version.sh env)" LDFLAGS="$(./scripts/get_version.sh ldflags) -X 'google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn'" export CGO_CFLAGS="-Wno-deprecated-declarations" @@ -220,11 +231,10 @@ jobs: fi if [ "${{ runner.os }}" = "Windows" ]; then NSIS_FLAG="-nsis" - export GOFLAGS="-p=1" fi cd cmd/desktop - wails build -skipbindings -clean \ + wails build -clean \ -tags "${BUILD_TAGS}" \ -platform "${{ matrix.platform }}" \ ${NSIS_FLAG} \