From 3ff5362ea1fa3a32d833d597a74c3fe11e683053 Mon Sep 17 00:00:00 2001 From: zackees Date: Mon, 22 Jun 2026 14:04:04 -0700 Subject: [PATCH] ci: restore native Windows release builds --- .github/workflows/build.yml | 2 +- .github/workflows/release-auto.yml | 2 +- .github/workflows/template_native_build.yml | 13 +++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 57da24f3..c1fd9446 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,7 @@ jobs: macos_cross: false - target: x86_64-pc-windows-msvc - runner: ubuntu-24.04 + runner: windows-latest binary_ext: ".exe" linux_cross: false macos_cross: false diff --git a/.github/workflows/release-auto.yml b/.github/workflows/release-auto.yml index 2ec63e7f..1a748c61 100644 --- a/.github/workflows/release-auto.yml +++ b/.github/workflows/release-auto.yml @@ -170,7 +170,7 @@ jobs: macos_cross: false - target: x86_64-pc-windows-msvc - runner: ubuntu-24.04 + runner: windows-latest binary_ext: ".exe" linux_cross: false macos_cross: false diff --git a/.github/workflows/template_native_build.yml b/.github/workflows/template_native_build.yml index 16f0b28d..3fb419a3 100644 --- a/.github/workflows/template_native_build.yml +++ b/.github/workflows/template_native_build.yml @@ -89,15 +89,16 @@ jobs: sudo apt-get update sudo apt-get install -y musl-tools pkg-config - # Windows MSVC release artifacts are built from Linux with cargo-xwin. + # Windows MSVC release artifacts can be cross-built from Linux with + # cargo-xwin, but native Windows runners use the standard cargo path. - name: Install cargo-xwin - if: contains(inputs.target, 'pc-windows-msvc') + if: runner.os == 'Linux' && contains(inputs.target, 'pc-windows-msvc') uses: taiki-e/install-action@v2 with: tool: cargo-xwin - name: Install xwin system dependencies - if: contains(inputs.target, 'pc-windows-msvc') + if: runner.os == 'Linux' && contains(inputs.target, 'pc-windows-msvc') run: | sudo apt-get update sudo apt-get install -y --no-install-recommends clang lld zip @@ -112,7 +113,7 @@ jobs: run: pip install cargo-zigbuild - name: Fetch Windows Python lib for PyO3 cross-compile - if: contains(inputs.target, 'pc-windows-msvc') + if: runner.os == 'Linux' && contains(inputs.target, 'pc-windows-msvc') shell: bash run: | set -euo pipefail @@ -138,7 +139,7 @@ jobs: - name: Build release binaries shell: bash run: | - if [[ "${{ inputs.target }}" == *-pc-windows-msvc ]]; then + if [ "${{ runner.os }}" = "Linux" ] && [[ "${{ inputs.target }}" == *-pc-windows-msvc ]]; then cargo xwin build --release --target ${{ inputs.target }} \ -p fbuild-cli \ -p fbuild-daemon @@ -172,7 +173,7 @@ jobs: shell: bash run: | PYTHON_TARGET_DIR="target/python-extension" - if [[ "${{ inputs.target }}" == *-pc-windows-msvc ]]; then + if [ "${{ runner.os }}" = "Linux" ] && [[ "${{ inputs.target }}" == *-pc-windows-msvc ]]; then PYO3_NO_PYTHON=1 cargo xwin build --release \ --target-dir "${PYTHON_TARGET_DIR}" \ --target ${{ inputs.target }} -p fbuild-python \