Add Windows CUDA release artifacts (#8750)

Signed-off-by: jh-block <jhugo@block.xyz>
This commit is contained in:
jh-block
2026-04-27 21:51:11 +02:00
committed by GitHub
parent 002440b48a
commit ce928f04e8
10 changed files with 217 additions and 45 deletions
+61 -17
View File
@@ -31,36 +31,44 @@ jobs:
fail-fast: false
matrix:
include:
# Linux builds
- os: ubuntu-latest
architecture: x86_64
target-suffix: unknown-linux-gnu
build-on: ubuntu-latest
use-cross: true
cc: gcc-10
variant: standard
- os: ubuntu-latest
architecture: aarch64
target-suffix: unknown-linux-gnu
build-on: ubuntu-latest
use-cross: true
cc: gcc-10
# macOS builds
variant: standard
- os: macos-latest
architecture: x86_64
target-suffix: apple-darwin
build-on: macos-latest
use-cross: true
variant: standard
- os: macos-latest
architecture: aarch64
target-suffix: apple-darwin
build-on: macos-latest
use-cross: true
# Windows builds (only x86_64 supported)
variant: standard
- os: windows
architecture: x86_64
target-suffix: pc-windows-msvc
build-on: windows-latest
use-cross: false
variant: standard
- os: windows
architecture: x86_64
target-suffix: pc-windows-msvc
build-on: windows-latest
use-cross: false
variant: cuda
steps:
- name: Checkout code
@@ -89,7 +97,7 @@ jobs:
if: matrix.os == 'windows'
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
with:
key: windows-msvc-cli
key: windows-msvc-cli-${{ matrix.variant }}
- name: Build CLI (Linux/macOS)
if: matrix.use-cross
@@ -118,21 +126,54 @@ jobs:
rustup show
rustup target add x86_64-pc-windows-msvc
- name: Install CUDA toolkit (Windows CUDA)
if: ${{ matrix.os == 'windows' && matrix.variant == 'cuda' }}
uses: Jimver/cuda-toolkit@v0.2.35
with:
cuda: '12.9.1'
method: 'local'
log-file-suffix: 'build-cli-windows-cuda.txt'
- name: Set up MSVC developer environment (Windows CUDA)
if: ${{ matrix.os == 'windows' && matrix.variant == 'cuda' }}
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
with:
arch: amd64
- name: Verify CUDA toolchain (Windows CUDA)
if: ${{ matrix.os == 'windows' && matrix.variant == 'cuda' }}
shell: pwsh
env:
CUDA_COMPUTE_CAP: "80"
run: |
Write-Output "CUDA_PATH=$env:CUDA_PATH"
Write-Output "CUDA_COMPUTE_CAP=$env:CUDA_COMPUTE_CAP"
where.exe cl
where.exe nvcc
nvcc -V
- name: Build CLI (Windows)
if: matrix.os == 'windows'
shell: bash
shell: pwsh
env:
CUDA_COMPUTE_CAP: ${{ matrix.variant == 'cuda' && '80' || '' }}
run: |
echo "🚀 Building Windows CLI executable..."
cargo build --release --target x86_64-pc-windows-msvc -p goose-cli
Write-Output "Building Windows CLI executable..."
if ("${{ matrix.variant }}" -eq "cuda") {
$cudaRustflagsConfig = 'target.x86_64-pc-windows-msvc.rustflags=["-C","target-feature=+crt-static"]'
cargo build --config $cudaRustflagsConfig --release --target x86_64-pc-windows-msvc -p goose-cli --features cuda
} else {
cargo build --release --target x86_64-pc-windows-msvc -p goose-cli
}
if [ ! -f "./target/x86_64-pc-windows-msvc/release/goose.exe" ]; then
echo "❌ Windows CLI binary not found."
ls -la ./target/x86_64-pc-windows-msvc/release/ || echo "Release directory doesn't exist"
if (-not (Test-Path "./target/x86_64-pc-windows-msvc/release/goose.exe")) {
Write-Error "Windows CLI binary not found."
Get-ChildItem ./target/x86_64-pc-windows-msvc/release/ -ErrorAction SilentlyContinue
exit 1
fi
}
echo "✅ Windows CLI binary found!"
ls -la ./target/x86_64-pc-windows-msvc/release/goose.exe
Write-Output "Windows CLI binary found."
Get-Item ./target/x86_64-pc-windows-msvc/release/goose.exe
- name: Package CLI (Linux/macOS)
if: matrix.use-cross
@@ -157,21 +198,24 @@ jobs:
shell: bash
run: |
export TARGET="${{ matrix.architecture }}-${{ matrix.target-suffix }}"
export VARIANT_SUFFIX=""
if [ "${{ matrix.variant }}" = "cuda" ]; then
VARIANT_SUFFIX="-cuda"
fi
mkdir -p "target/${TARGET}/release/goose-package"
cp "target/${TARGET}/release/goose.exe" "target/${TARGET}/release/goose-package/"
cd "target/${TARGET}/release"
7z a -tzip "goose-${TARGET}.zip" goose-package/
echo "ARTIFACT_ZIP=target/${TARGET}/release/goose-${TARGET}.zip" >> $GITHUB_ENV
7z a -tzip "goose-${TARGET}${VARIANT_SUFFIX}.zip" goose-package/
echo "ARTIFACT_ZIP=target/${TARGET}/release/goose-${TARGET}${VARIANT_SUFFIX}.zip" >> $GITHUB_ENV
- name: Upload CLI artifact
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: goose-${{ matrix.architecture }}-${{ matrix.target-suffix }}
name: goose-${{ matrix.architecture }}-${{ matrix.target-suffix }}${{ matrix.variant == 'cuda' && '-cuda' || '' }}
path: |
${{ env.ARTIFACT_BZ2 }}
${{ env.ARTIFACT_GZ }}
${{ env.ARTIFACT_ZIP }}
+71 -20
View File
@@ -8,6 +8,11 @@ on:
required: false
type: boolean
default: false
windows_variant:
description: 'Windows artifact variant to build'
required: false
type: string
default: 'standard'
workflow_call:
inputs:
version:
@@ -24,6 +29,11 @@ on:
required: false
type: string
default: ''
windows_variant:
description: 'Windows artifact variant to build'
required: false
type: string
default: 'standard'
# Permissions required for OIDC authentication with Azure Trusted Signing
permissions:
@@ -64,7 +74,7 @@ jobs:
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
key: windows-msvc-desktop
key: windows-msvc-desktop-${{ inputs.windows_variant }}
- name: Setup Rust
shell: bash
@@ -72,21 +82,54 @@ jobs:
rustup show
rustup target add x86_64-pc-windows-msvc
- name: Build Windows executable
shell: bash
- name: Install CUDA toolkit (Windows CUDA)
if: ${{ inputs.windows_variant == 'cuda' }}
uses: Jimver/cuda-toolkit@v0.2.35
with:
cuda: '12.9.1'
method: 'local'
log-file-suffix: 'bundle-desktop-windows-cuda.txt'
- name: Set up MSVC developer environment (Windows CUDA)
if: ${{ inputs.windows_variant == 'cuda' }}
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
with:
arch: amd64
- name: Verify CUDA toolchain (Windows CUDA)
if: ${{ inputs.windows_variant == 'cuda' }}
shell: pwsh
env:
CUDA_COMPUTE_CAP: "80"
run: |
echo "🚀 Building Windows executable..."
cargo build --release --target x86_64-pc-windows-msvc
Write-Output "CUDA_PATH=$env:CUDA_PATH"
Write-Output "CUDA_COMPUTE_CAP=$env:CUDA_COMPUTE_CAP"
where.exe cl
where.exe nvcc
nvcc -V
- name: Build Windows executable
shell: pwsh
env:
CUDA_COMPUTE_CAP: ${{ inputs.windows_variant == 'cuda' && '80' || '' }}
run: |
Write-Output "Building Windows executable..."
if ("${{ inputs.windows_variant }}" -eq "cuda") {
$cudaRustflagsConfig = 'target.x86_64-pc-windows-msvc.rustflags=["-C","target-feature=+crt-static"]'
cargo build --config $cudaRustflagsConfig --release --target x86_64-pc-windows-msvc -p goose-server --features cuda
} else {
cargo build --release --target x86_64-pc-windows-msvc -p goose-server
}
# Verify build succeeded
if [ ! -f "./target/x86_64-pc-windows-msvc/release/goosed.exe" ]; then
echo "❌ Windows binary not found."
ls -la ./target/x86_64-pc-windows-msvc/release/ || echo "Release directory doesn't exist"
if (-not (Test-Path "./target/x86_64-pc-windows-msvc/release/goosed.exe")) {
Write-Error "Windows binary not found."
Get-ChildItem ./target/x86_64-pc-windows-msvc/release/ -ErrorAction SilentlyContinue
exit 1
fi
}
echo "✅ Windows binary found!"
ls -la ./target/x86_64-pc-windows-msvc/release/goosed.exe
Write-Output "Windows binary found."
Get-Item ./target/x86_64-pc-windows-msvc/release/goosed.exe
- name: Prepare Windows binary
shell: bash
@@ -155,7 +198,7 @@ jobs:
- name: Upload unsigned distribution
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: windows-unsigned
name: windows-unsigned${{ inputs.windows_variant == 'cuda' && '-cuda' || '' }}
path: ui/desktop/dist-windows/
sign-desktop-windows:
@@ -169,7 +212,7 @@ jobs:
- name: Download unsigned distribution
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: windows-unsigned
name: windows-unsigned${{ inputs.windows_variant == 'cuda' && '-cuda' || '' }}
path: dist-windows
- name: Azure login
@@ -206,13 +249,17 @@ jobs:
- name: Create Windows zip package
shell: bash
run: |
7z a -tzip "Goose-win32-x64.zip" dist-windows/
ZIP_NAME="Goose-win32-x64"
if [ "${{ inputs.windows_variant }}" = "cuda" ]; then
ZIP_NAME="${ZIP_NAME}-cuda"
fi
7z a -tzip "${ZIP_NAME}.zip" dist-windows/
- name: Upload signed Windows build
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: Goose-win32-x64
path: Goose-win32-x64.zip
name: Goose-win32-x64${{ inputs.windows_variant == 'cuda' && '-cuda' || '' }}
path: Goose-win32-x64${{ inputs.windows_variant == 'cuda' && '-cuda' || '' }}.zip
# When signing is disabled, package the unsigned build directly
package-desktop-windows:
@@ -225,16 +272,20 @@ jobs:
- name: Download unsigned distribution
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: windows-unsigned
name: windows-unsigned${{ inputs.windows_variant == 'cuda' && '-cuda' || '' }}
path: dist-windows
- name: Create Windows zip package
shell: bash
run: |
7z a -tzip "Goose-win32-x64.zip" dist-windows/
ZIP_NAME="Goose-win32-x64"
if [ "${{ inputs.windows_variant }}" = "cuda" ]; then
ZIP_NAME="${ZIP_NAME}-cuda"
fi
7z a -tzip "${ZIP_NAME}.zip" dist-windows/
- name: Upload Windows build
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: Goose-win32-x64
path: Goose-win32-x64.zip
name: Goose-win32-x64${{ inputs.windows_variant == 'cuda' && '-cuda' || '' }}
path: Goose-win32-x64${{ inputs.windows_variant == 'cuda' && '-cuda' || '' }}.zip
+11 -1
View File
@@ -111,13 +111,21 @@ jobs:
version: ${{ needs.prepare-version.outputs.version }}
signing: false
bundle-desktop-windows-cuda:
needs: [prepare-version]
uses: ./.github/workflows/bundle-desktop-windows.yml
with:
version: ${{ needs.prepare-version.outputs.version }}
signing: false
windows_variant: cuda
# ------------------------------------
# 7) Create/Update GitHub Release
# ------------------------------------
release:
name: Release
runs-on: ubuntu-latest
needs: [build-cli, install-script, bundle-desktop, bundle-desktop-intel, bundle-desktop-linux, bundle-desktop-windows]
needs: [build-cli, install-script, bundle-desktop, bundle-desktop-intel, bundle-desktop-linux, bundle-desktop-windows, bundle-desktop-windows-cuda]
permissions:
contents: write
id-token: write # Required for Sigstore OIDC signing
@@ -135,6 +143,7 @@ jobs:
subject-path: |
goose-*.tar.bz2
goose-*.tar.gz
goose-*.zip
Goose*.zip
*.deb
*.rpm
@@ -151,6 +160,7 @@ jobs:
artifacts: |
goose-*.tar.bz2
goose-*.tar.gz
goose-*.zip
Goose*.zip
*.deb
*.rpm
+2 -1
View File
@@ -140,7 +140,8 @@ jobs:
- [📦 Linux (aarch64)](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/goose-aarch64-unknown-linux-gnu.zip)
- [📦 macOS (x86_64)](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/goose-x86_64-apple-darwin.zip)
- [📦 macOS (aarch64)](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/goose-aarch64-apple-darwin.zip)
- [📦 Windows (x86_64)](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/goose-x86_64-pc-windows-gnu.zip)
- [📦 Windows (x86_64)](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/goose-x86_64-pc-windows-msvc.zip)
- [📦 Windows CUDA (x86_64)](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/goose-x86_64-pc-windows-msvc-cuda.zip)
These links are provided by nightly.link and will work even if you're not logged into GitHub.
+12 -1
View File
@@ -85,13 +85,24 @@ jobs:
signing: true
secrets: inherit
bundle-desktop-windows-cuda:
uses: ./.github/workflows/bundle-desktop-windows.yml
permissions:
id-token: write
contents: read
actions: read
with:
signing: true
windows_variant: cuda
secrets: inherit
# ------------------------------------
# 7) Create/Update GitHub Release
# ------------------------------------
release:
name: Release
runs-on: ubuntu-latest
needs: [build-cli, install-script, bundle-desktop, bundle-desktop-intel, bundle-desktop-linux, bundle-desktop-windows]
needs: [build-cli, install-script, bundle-desktop, bundle-desktop-intel, bundle-desktop-linux, bundle-desktop-windows, bundle-desktop-windows-cuda]
permissions:
contents: write
id-token: write # Required for Sigstore OIDC signing