Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Bazel for Windows builds #380

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 9 additions & 52 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- ubuntu-20.04
# - ubuntu-22.04
# - ubuntu-24.04
# - windows
- windows
include:
- build: macos
os: macos-latest
Expand All @@ -72,9 +72,9 @@ jobs:
# - build: ubuntu-24.04
# os: ubuntu-24.04
# buildflags: --features=negotiate
# - build: windows
# os: windows-latest
# buildflags: --features=negotiate
- build: windows
os: windows-latest
buildflags: --features=negotiate

steps:
- name: Checkout repository
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-24.04
# - windows
- windows
include:
- build: macos-aarch64
os: macos-latest
Expand All @@ -167,10 +167,10 @@ jobs:
os: ubuntu-24.04
buildflags: --features=negotiate
pkgfile: proxydetox-${{ needs.version.outputs.version }}-noble_amd64.deb
# - build: windows
# os: windows-latest
# buildflags: --features=negotiate
# pkgfile: proxydetox-${{ needs.version.outputs.version }}-windows-x86_64.zip
- build: windows
os: windows-latest
buildflags: --features=negotiate
pkgfile: proxydetox-${{ needs.version.outputs.version }}-windows-x86_64.zip

steps:
- name: Checkout repository
Expand Down Expand Up @@ -230,54 +230,12 @@ jobs:
name: pkg-bazel-${{ matrix.build }}
path: ./${{ matrix.pkgfile }}

cargo_build_and_test:
name: Cargo build and test
runs-on: windows-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}
# see https://github.com/rust-lang/rust-bindgen/issues/1797
- name: Install Windows dependency (LLVM)
uses: KyleMayes/install-llvm-action@v2.0.3
if: startswith(runner.os, 'windows')
with:
version: "11.0"
directory: ${{ runner.temp }}/llvm
- name: Set LIBCLANG_PATH
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
shell: pwsh
if: startswith(runner.os, 'windows')
- name: Run cargo test
run: cargo test
- name: Build Release Package
id: buildpkg
run: ./tools/mkzip.ps1
shell: pwsh
- name: Upload package artifact
uses: actions/upload-artifact@v4
with:
name: pkg-cargo-windows
path: ./${{ steps.buildpkg.outputs.pkgfile }}

mkrelease:
name: Create Release
runs-on: ubuntu-latest
needs:
- version
- bazel_build
- cargo_build_and_test
steps:
- name: Download pkg artifact
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -330,7 +288,6 @@ jobs:
if: always()
needs:
- bazel_build
- cargo_build_and_test
- format_check
runs-on: ubuntu-latest
steps:
Expand Down
Loading