From eb340f9a2a735c3e471cfa74f167de8a3a83d518 Mon Sep 17 00:00:00 2001 From: Song Lim Date: Fri, 4 Oct 2024 18:38:08 +0800 Subject: [PATCH] ci: cross compile to windows --- .github/workflows/release.yml | 4 ++++ .goreleaser.yaml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ba397ec..b713905 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,6 +18,10 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Install MinGW for cross-compiling to Windows + run: | + sudo apt-get update + sudo apt-get install -y gcc-mingw-w64 g++-mingw-w64 - name: Set up Go uses: actions/setup-go@v5 with: diff --git a/.goreleaser.yaml b/.goreleaser.yaml index c4f213a..a8c74ac 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -11,6 +11,8 @@ before: builds: - env: - CGO_ENABLED=1 + - CC_windows_amd64=x86_64-w64-mingw32-gc + - CXX_windows_amd64=x86_64-w64-mingw32-g++ goos: - windows goarch: