Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.'cfg(target_env = "msvc")']
rustflags = ["-l", "advapi32"]
62 changes: 37 additions & 25 deletions .github/workflows/build-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
type: string
required: false
default: ""
pull_request:

name: "Reusable workflow to build CLI"

Expand All @@ -29,31 +30,30 @@ 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
- os: ubuntu-latest
architecture: aarch64
target-suffix: unknown-linux-gnu
build-on: ubuntu-latest
use-cross: true
cc: gcc-10
# macOS builds
- os: macos-latest
architecture: x86_64
target-suffix: apple-darwin
build-on: macos-latest
use-cross: true
- os: macos-latest
architecture: aarch64
target-suffix: apple-darwin
build-on: macos-latest
use-cross: true
# Windows builds (only x86_64 supported)
# # Linux builds
# - os: ubuntu-latest
# architecture: x86_64
# target-suffix: unknown-linux-gnu
# build-on: ubuntu-latest
# use-cross: true
# cc: gcc-10
# - os: ubuntu-latest
# architecture: aarch64
# target-suffix: unknown-linux-gnu
# build-on: ubuntu-latest
# use-cross: true
# cc: gcc-10
# # macOS builds
# - os: macos-latest
# architecture: x86_64
# target-suffix: apple-darwin
# build-on: macos-latest
# use-cross: true
# - os: macos-latest
# architecture: aarch64
# target-suffix: apple-darwin
# build-on: macos-latest
# use-cross: true
- os: windows
architecture: x86_64
target-suffix: pc-windows-gnu
Expand Down Expand Up @@ -200,6 +200,8 @@ jobs:
ls -la target/x86_64-pc-windows-gnu/release/
"

sudo chown -R $USER:$USER target/

# Verify build succeeded
if [ ! -f "./target/x86_64-pc-windows-gnu/release/goose.exe" ]; then
echo "❌ Windows CLI binary not found."
Expand All @@ -219,6 +221,11 @@ jobs:
source ./bin/activate-hermit
export TARGET="${{ matrix.architecture }}-${{ matrix.target-suffix }}"

df
ls -l target/
ls -l target/${TARGET}
ls -l target/${TARGET}/release

# Create a directory for the package contents
mkdir -p "target/${TARGET}/release/goose-package"

Expand All @@ -235,6 +242,11 @@ jobs:
run: |
export TARGET="${{ matrix.architecture }}-${{ matrix.target-suffix }}"

df
ls -l target/
ls -l target/${TARGET}
ls -l target/${TARGET}/release

# Create a directory for the package contents
mkdir -p "target/${TARGET}/release/goose-package"

Expand Down
161 changes: 161 additions & 0 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
name: "Build Windows"

on:
workflow_call:
inputs:
ref:
type: string
required: false
default: ""
description: "Git ref to checkout"
pull_request:
paths-ignore:
- "documentation/**"
workflow_dispatch:

jobs:
build-windows-native:
name: Build on Windows Native
runs-on: windows-latest

steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4
with:
ref: ${{ inputs.ref }}
fetch-depth: 0

- name: Set up Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy, rustfmt

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2
with:
key: windows-native-${{ runner.arch }}

- name: Check Rust environment
shell: powershell
run: |
Write-Host "=== Rust Environment Information ==="
rustc --version
cargo --version
rustup show

Write-Host "=== Cargo Configuration ==="
if (Test-Path "$env:USERPROFILE\.cargo\config.toml") {
Get-Content "$env:USERPROFILE\.cargo\config.toml"
} else {
Write-Host "No global cargo config found"
}

Write-Host "=== Available Rust Targets ==="
rustup target list --installed

- name: Build goose CLI
shell: powershell
run: |
Write-Host "=== Building goose CLI ==="
$env:RUST_BACKTRACE = "1"
$env:CARGO_INCREMENTAL = "1"

Write-Host "Building goose-cli..."
cargo build --release -p goose-cli

if (Test-Path "target/release/goose.exe") {
Write-Host "✅ goose.exe built successfully"
$size = (Get-Item "target/release/goose.exe").Length
Write-Host "Binary size: $([math]::Round($size/1MB, 2)) MB"
} else {
Write-Error "❌ goose.exe not found after build"
exit 1
}

- name: Build goose server (goosed)
shell: powershell
run: |
Write-Host "=== Building goose server ==="
$env:RUST_BACKTRACE = "1"
$env:CARGO_INCREMENTAL = "1"

Write-Host "Building goose-server..."
cargo build --release -p goose-server --verbose

if (Test-Path "target/release/goosed.exe") {
Write-Host "✅ goosed.exe built successfully"
$size = (Get-Item "target/release/goosed.exe").Length
Write-Host "Binary size: $([math]::Round($size/1MB, 2)) MB"
} else {
Write-Error "❌ goosed.exe not found after build"
exit 1
}

# - name: Run tests
# shell: powershell
# run: |
# Write-Host "=== Running tests ==="
# $env:RUST_BACKTRACE = "1"

# Write-Host "Running goose crate tests..."
# cargo test -p goose --verbose

# Write-Host "Running goose-cli tests..."
# cargo test -p goose-cli --verbose

# Write-Host "Running goose-server tests..."
# cargo test -p goose-server --verbose

# - name: Run clippy
# shell: powershell
# run: |
# Write-Host "=== Running clippy ==="
# cargo clippy --all-targets --all-features -- -D warnings

# - name: Check formatting
# shell: powershell
# run: |
# Write-Host "=== Checking code formatting ==="
# cargo fmt --all -- --check

- name: Prepare artifacts
shell: powershell
run: |
Write-Host "=== Preparing artifacts ==="

# Create artifact directory
New-Item -ItemType Directory -Force -Path "artifacts"

# Copy binaries
Copy-Item "target/release/goose.exe" "artifacts/"
Copy-Item "target/release/goosed.exe" "artifacts/"

# Create version info file
$version = "dev-build"
@{
version = $version
commit = "${{ github.sha }}"
build_time = Get-Date -Format "yyyy-MM-dd HH:mm:ss UTC"
runner_os = "${{ runner.os }}"
runner_arch = "${{ runner.arch }}"
} | ConvertTo-Json | Out-File "artifacts/build-info.json" -Encoding UTF8

Write-Host "Artifacts prepared:"
Get-ChildItem "artifacts" | ForEach-Object {
$size = if ($_.PSIsContainer) { "Directory" } else { "$([math]::Round($_.Length/1MB, 2)) MB" }
Write-Host " $($_.Name) - $size"
}

- name: Upload artifacts
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # pin@v4
with:
name: goose-windows-native-${{ runner.arch }}
path: artifacts/
retention-days: 7

- name: Upload CLI binary (for compatibility)
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # pin@v4
with:
name: goose-x86_64-pc-windows-msvc
path: target/release/goose.exe
retention-days: 7
22 changes: 0 additions & 22 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ concurrency:
cancel-in-progress: true

jobs:
# ------------------------------------
# 1) Prepare Version
# ------------------------------------
prepare-version:
name: Prepare Version
runs-on: ubuntu-latest
Expand All @@ -36,18 +33,12 @@ jobs:
VERSION="${VERSION}-canary+${SHORT_SHA}"
echo "version=$VERSION" >> $GITHUB_OUTPUT

# ------------------------------------
# 2) Build CLI for multiple OS/Arch
# ------------------------------------
build-cli:
needs: [prepare-version]
uses: ./.github/workflows/build-cli.yml
with:
version: ${{ needs.prepare-version.outputs.version }}

# ------------------------------------
# 3) Upload Install CLI Script (we only need to do this once)
# ------------------------------------
install-script:
name: Upload Install Script
runs-on: ubuntu-latest
Expand All @@ -59,9 +50,6 @@ jobs:
name: download_cli.sh
path: download_cli.sh

# ------------------------------------------------------------
# 4) Bundle Desktop App (macOS only) - builds goosed and Electron app
# ------------------------------------------------------------
bundle-desktop:
needs: [prepare-version]
uses: ./.github/workflows/bundle-desktop.yml
Expand All @@ -72,28 +60,19 @@ jobs:
version: ${{ needs.prepare-version.outputs.version }}
signing: false

# ------------------------------------------------------------
# 5) Bundle Desktop App (Linux) - builds goosed and Electron app
# ------------------------------------------------------------
bundle-desktop-linux:
needs: [prepare-version]
uses: ./.github/workflows/bundle-desktop-linux.yml
with:
version: ${{ needs.prepare-version.outputs.version }}

# ------------------------------------------------------------
# 6) Bundle Desktop App (Windows) - builds goosed and Electron app
# ------------------------------------------------------------
bundle-desktop-windows:
needs: [prepare-version]
uses: ./.github/workflows/bundle-desktop-windows.yml
with:
version: ${{ needs.prepare-version.outputs.version }}
signing: false

# ------------------------------------
# 7) Create/Update GitHub Release
# ------------------------------------
release:
name: Release
runs-on: ubuntu-latest
Expand All @@ -107,7 +86,6 @@ jobs:
with:
merge-multiple: true

# Create/update the canary release
- name: Release canary
uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 # pin@v1
with:
Expand Down
Loading
Loading