Fix Windows slipstream: install mingw-w64-x86_64-gcc via pacman so gc… #42
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - goos: linux | |
| goarch: amd64 | |
| suffix: linux-amd64 | |
| - goos: linux | |
| goarch: arm64 | |
| suffix: linux-arm64 | |
| - goos: darwin | |
| goarch: amd64 | |
| suffix: darwin-amd64 | |
| - goos: darwin | |
| goarch: arm64 | |
| suffix: darwin-arm64 | |
| - goos: windows | |
| goarch: amd64 | |
| suffix: windows-amd64.exe | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| - name: Build | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| CGO_ENABLED: '0' | |
| run: go build -ldflags="-s -w" -o findns-${{ matrix.suffix }} ./cmd | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: findns-${{ matrix.suffix }} | |
| path: findns-${{ matrix.suffix }} | |
| build-slipstream-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout slipstream-rust | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: Mygod/slipstream-rust | |
| path: slipstream-rust | |
| submodules: recursive | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install deps | |
| run: | | |
| sudo apt-get update -q | |
| sudo apt-get install -y cmake libssl-dev | |
| - name: Build | |
| working-directory: slipstream-rust | |
| env: | |
| PICOQUIC_AUTO_BUILD: '1' | |
| run: | | |
| cargo build --release -p slipstream-client --features slipstream-ffi/openssl-vendored | |
| cp target/release/slipstream-client ../slipstream-client-linux-amd64 | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: slipstream-client-linux-amd64 | |
| path: slipstream-client-linux-amd64 | |
| build-slipstream-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout slipstream-rust | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: Mygod/slipstream-rust | |
| path: slipstream-rust | |
| submodules: recursive | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: x86_64-pc-windows-gnu | |
| - name: Install deps | |
| shell: bash | |
| run: | | |
| choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y | |
| # Install MinGW-native OpenSSL via MSYS2 (provides libcrypto.a / libssl.a for MinGW) | |
| C:/msys64/usr/bin/pacman -S --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-openssl mingw-w64-x86_64-pkg-config | |
| - name: Pre-build picoquic with bash (MSYS2 MinGW) | |
| shell: bash | |
| working-directory: slipstream-rust | |
| env: | |
| PICOQUIC_BUILD_DIR: ${{ github.workspace }}/slipstream-rust/.picoquic-build | |
| CMAKE_GENERATOR: MinGW Makefiles | |
| OPENSSL_ROOT_DIR: C:/msys64/mingw64 | |
| CC: C:/msys64/mingw64/bin/gcc.exe | |
| CXX: C:/msys64/mingw64/bin/g++.exe | |
| AR: C:/msys64/mingw64/bin/ar.exe | |
| run: | | |
| export PATH="/c/msys64/mingw64/bin:$PATH" | |
| bash scripts/build_picoquic.sh | |
| - name: Build slipstream-client | |
| shell: bash | |
| working-directory: slipstream-rust | |
| env: | |
| PICOQUIC_BUILD_DIR: ${{ github.workspace }}/slipstream-rust/.picoquic-build | |
| OPENSSL_ROOT_DIR: C:/msys64/mingw64 | |
| CC: C:/msys64/mingw64/bin/gcc.exe | |
| CXX: C:/msys64/mingw64/bin/g++.exe | |
| AR: C:/msys64/mingw64/bin/ar.exe | |
| CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: C:/msys64/mingw64/bin/gcc.exe | |
| run: | | |
| export PATH="/c/msys64/mingw64/bin:$PATH" | |
| cargo build --release -p slipstream-client --target x86_64-pc-windows-gnu --features slipstream-ffi/openssl-vendored | |
| cp target/x86_64-pc-windows-gnu/release/slipstream-client.exe ../slipstream-client-windows-amd64.exe | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: slipstream-client-windows-amd64.exe | |
| path: slipstream-client-windows-amd64.exe | |
| release: | |
| needs: [build, build-slipstream-linux, build-slipstream-windows] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: artifacts/* | |
| generate_release_notes: true |