Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.
ci(cli): build with --no-default-features and guard against GUI crates (#8539)
Akarshan Biswas09356bcf9447
diff --git a/.github/workflows/template-cli-build-linux-x64.yml b/.github/workflows/template-cli-build-linux-x64.ymlindex 5b3e23e29..17d47d331 100644--- a/.github/workflows/template-cli-build-linux-x64.yml+++ b/.github/workflows/template-cli-build-linux-x64.yml@@ -54,7 +54,20 @@ jobs:JAN_CLI_BUILD_VERSION: ${{ inputs.new_version }}run: |cd src-tauri- cargo build --features cli --bin jan --release+ cargo build --no-default-features --features cli --bin jan --release++ - name: Assert no GUI crates+ run: |+ cd src-tauri+ if cargo tree --no-default-features --features cli -i tauri >/dev/null 2>&1 || \+ cargo tree --no-default-features --features cli -i gtk >/dev/null 2>&1 || \+ cargo tree --no-default-features --features cli -i gdk >/dev/null 2>&1 || \+ cargo tree --no-default-features --features cli -i muda >/dev/null 2>&1 || \+ cargo tree --no-default-features --features cli -i wry >/dev/null 2>&1 || \+ cargo tree --no-default-features --features cli -i webkit2gtk >/dev/null 2>&1; then+ echo "GUI crate leaked into the CLI dependency graph" >&2+ exit 1+ fi- name: Strip binaryrun: strip src-tauri/target/release/jandiff --git a/.github/workflows/template-cli-build-macos.yml b/.github/workflows/template-cli-build-macos.ymlindex 1aea354eb..95d6e8ea2 100644--- a/.github/workflows/template-cli-build-macos.yml+++ b/.github/workflows/template-cli-build-macos.yml@@ -66,7 +66,7 @@ jobs:JAN_CLI_BUILD_VERSION: ${{ inputs.new_version }}run: |cd src-tauri- cargo build --features cli --bin jan --release --target x86_64-apple-darwin+ cargo build --no-default-features --features cli --bin jan --release --target x86_64-apple-darwin- name: Build CLI binary (aarch64)env:@@ -74,7 +74,7 @@ jobs:JAN_CLI_BUILD_VERSION: ${{ inputs.new_version }}run: |cd src-tauri- cargo build --features cli --bin jan --release --target aarch64-apple-darwin+ cargo build --no-default-features --features cli --bin jan --release --target aarch64-apple-darwin- name: Create universal binaryrun: |diff --git a/.github/workflows/template-cli-build-windows-x64.yml b/.github/workflows/template-cli-build-windows-x64.ymlindex 0fb62d235..13f9f7c8e 100644--- a/.github/workflows/template-cli-build-windows-x64.yml+++ b/.github/workflows/template-cli-build-windows-x64.yml@@ -54,7 +54,7 @@ jobs:JAN_CLI_BUILD_VERSION: ${{ inputs.new_version }}run: |cd src-tauri- cargo build --features cli --bin jan --release+ cargo build --no-default-features --features cli --bin jan --release- name: Package zipid: package