Skip to content

Commit 89f1c02

Browse files
committed
fix: windows binary build
1 parent 28b6366 commit 89f1c02

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.github/workflows/build-binaries.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
push:
55
tags:
66
- "v[0-9]+.[0-9]+.[0-9]+"
7-
release:
8-
types: [created]
97

108
permissions:
119
contents: write
@@ -16,6 +14,7 @@ jobs:
1614
build-binaries:
1715
runs-on: ${{ matrix.os }}
1816
strategy:
17+
fail-fast: false
1918
matrix:
2019
include:
2120
- os: ubuntu-24.04
@@ -38,6 +37,10 @@ jobs:
3837
target: x86_64-pc-windows-gnu
3938
arch: x86_64
4039
platform: windows
40+
- os: windows-2025
41+
target: x86_64-pc-windows-msvc
42+
arch: x86_64
43+
platform: windows
4144

4245
steps:
4346
- name: Checkout code
@@ -92,7 +95,7 @@ jobs:
9295
- name: Build artifacts for Windows
9396
if: matrix.platform == 'windows'
9497
shell: bash
95-
run: ./package/build-artifacts-windows.sh
98+
run: ./package/build-artifacts-windows.sh ${{ matrix.target }}
9699

97100
- name: Upload artifact (Linux)
98101
if: matrix.platform == 'linux'

package/build-artifacts-windows.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -euo pipefail
44

5-
TARGET_TRIPLE="x86_64-pc-windows-gnu"
5+
TARGET_TRIPLE=${1:?Target triple must be provided}
66

77
echo "--- Preparing to build artifacts for Windows target: $TARGET_TRIPLE ---"
88

@@ -14,7 +14,11 @@ TMP_DIR=$(mktemp -d -p "$ARTIFACTS_DIR")
1414
trap 'rm -rf -- "$TMP_DIR"' EXIT
1515

1616
echo "--- Building backend ---"
17-
(cd backend && STATIC_DIR=./static cargo zigbuild --release --target "$TARGET_TRIPLE")
17+
if [[ "$TARGET_TRIPLE" == *"-msvc"* ]]; then
18+
(cd backend && STATIC_DIR=./static cargo build --release --target "$TARGET_TRIPLE")
19+
else
20+
(cd backend && STATIC_DIR=./static cargo zigbuild --release --target "$TARGET_TRIPLE")
21+
fi
1822

1923
echo "--- Building frontend ---"
2024
(cd frontend && NOMAP=T pnpm build)
@@ -32,6 +36,6 @@ echo "--- Creating zip archive ---"
3236
ZIP_NAME="$TARGET_TRIPLE.zip"
3337
ZIP_PATH="$ARTIFACTS_DIR/$ZIP_NAME"
3438

35-
(cd "$TMP_DIR" && zip -r "../$ZIP_NAME" .)
39+
(cd "$TMP_DIR" && 7z a -tzip "../$ZIP_NAME" ./)
3640

3741
echo "--- Artifact created successfully: $ZIP_PATH ---"

0 commit comments

Comments
 (0)