Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

feat(ci): ship windows arm64 on the stable channel

Minh141120f0dd508dc415
diff --git a/.github/workflows/jan-tauri-build-nightly.yaml b/.github/workflows/jan-tauri-build-nightly.yaml
index 8fe76e32b..da5bd1288 100644
--- a/.github/workflows/jan-tauri-build-nightly.yaml
+++ b/.github/workflows/jan-tauri-build-nightly.yaml
@@ -171,7 +171,8 @@ jobs:
WINDOWS_URL="https://delta.jan.ai/nightly/${{ needs.build-windows-x64.outputs.FILE_NAME }}"
# Empty when that leg failed or was skipped; the key is then left out
# rather than written blank, which the updater would find and fail on.
- WINDOWS_ARM_SIGNATURE="${{ needs.build-windows-arm64.outputs.WIN_SIG }}"
+ # Requires success too: WIN_SIG is set before the upload step.
+ WINDOWS_ARM_SIGNATURE="${{ needs.build-windows-arm64.result == 'success' && needs.build-windows-arm64.outputs.WIN_SIG || '' }}"
WINDOWS_ARM_URL="https://delta.jan.ai/nightly/${{ needs.build-windows-arm64.outputs.FILE_NAME }}"
[ -n "$WINDOWS_ARM_SIGNATURE" ] || echo "::warning::no ARM64 build this run -- publishing latest.json without windows-aarch64"
DARWIN_SIGNATURE="${{ needs.build-macos.outputs.MAC_UNIVERSAL_SIG }}"
diff --git a/.github/workflows/jan-tauri-build.yaml b/.github/workflows/jan-tauri-build.yaml
index 461fabb15..8c03d3d94 100644
--- a/.github/workflows/jan-tauri-build.yaml
+++ b/.github/workflows/jan-tauri-build.yaml
@@ -71,11 +71,33 @@ jobs:
new_version: ${{ needs.get-update-version.outputs.new_version }}
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
+ build-windows-arm64:
+ uses: ./.github/workflows/template-tauri-build-windows-arm64.yml
+ secrets: inherit
+ needs: [get-update-version, create-draft-release]
+ with:
+ ref: ${{ github.ref }}
+ public_provider: github
+ channel: stable
+ new_version: ${{ needs.get-update-version.outputs.new_version }}
+ upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
+ engine_variant: cuda13-vulkan
+ vulkan_fallback: '1'
+
sync-temp-to-latest:
- needs: [create-draft-release, get-update-version, build-macos, build-windows-x64, build-linux-x64]
+ needs: [create-draft-release, get-update-version, build-macos, build-windows-x64, build-linux-x64, build-windows-arm64]
runs-on: ubuntu-latest
permissions:
contents: write
+ # ARM is optional: if it fails, the other platforms still ship. `!cancelled()`
+ # drops the implicit success() gate, so the required legs are listed by hand.
+ if: >-
+ !cancelled()
+ && needs.create-draft-release.result == 'success'
+ && needs.get-update-version.result == 'success'
+ && needs.build-macos.result == 'success'
+ && needs.build-windows-x64.result == 'success'
+ && needs.build-linux-x64.result == 'success'
steps:
- name: Getting the repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
@@ -89,6 +111,11 @@ jobs:
LINUX_URL="https://github.com/janhq/jan/releases/download/v${{ needs.get-update-version.outputs.new_version }}/${{ needs.build-linux-x64.outputs.APPIMAGE_FILE_NAME }}"
WINDOWS_SIGNATURE="${{ needs.build-windows-x64.outputs.WIN_SIG }}"
WINDOWS_URL="https://github.com/janhq/jan/releases/download/v${{ needs.get-update-version.outputs.new_version }}/${{ needs.build-windows-x64.outputs.FILE_NAME }}"
+ # Blank unless the ARM leg succeeded (WIN_SIG is set before the upload
+ # step); a blank signature leaves windows-aarch64 out of the manifest.
+ WINDOWS_ARM_SIGNATURE="${{ needs.build-windows-arm64.result == 'success' && needs.build-windows-arm64.outputs.WIN_SIG || '' }}"
+ WINDOWS_ARM_URL="https://github.com/janhq/jan/releases/download/v${{ needs.get-update-version.outputs.new_version }}/${{ needs.build-windows-arm64.outputs.FILE_NAME }}"
+ [ -n "$WINDOWS_ARM_SIGNATURE" ] || echo "::warning::no ARM64 build this run -- publishing latest.json without windows-aarch64"
DARWIN_SIGNATURE="${{ needs.build-macos.outputs.MAC_UNIVERSAL_SIG }}"
DARWIN_URL="https://github.com/janhq/jan/releases/download/v${{ needs.get-update-version.outputs.new_version }}/${{ needs.build-macos.outputs.TAR_NAME }}"
@@ -98,6 +125,8 @@ jobs:
--arg linux_url "$LINUX_URL" \
--arg windows_signature "$WINDOWS_SIGNATURE" \
--arg windows_url "$WINDOWS_URL" \
+ --arg windows_arm_signature "$WINDOWS_ARM_SIGNATURE" \
+ --arg windows_arm_url "$WINDOWS_ARM_URL" \
--arg darwin_arm_signature "$DARWIN_SIGNATURE" \
--arg darwin_arm_url "$DARWIN_URL" \
--arg darwin_amd_signature "$DARWIN_SIGNATURE" \
@@ -108,6 +137,10 @@ jobs:
| .platforms["linux-x86_64"].url = $linux_url
| .platforms["windows-x86_64"].signature = $windows_signature
| .platforms["windows-x86_64"].url = $windows_url
+ | if $windows_arm_signature == "" then . else
+ .platforms["windows-aarch64"].signature = $windows_arm_signature
+ | .platforms["windows-aarch64"].url = $windows_arm_url
+ end
| .platforms["darwin-aarch64"].signature = $darwin_arm_signature
| .platforms["darwin-aarch64"].url = $darwin_arm_url
| .platforms["darwin-x86_64"].signature = $darwin_amd_signature
@@ -115,12 +148,8 @@ jobs:
src-tauri/latest.json.template > latest.json
cat latest.json
+ # --clobber so re-running a failed ARM leg can replace latest.json.
- name: Upload release assert if public provider is github
env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-release-asset@64e5e85fc528f162d7ba7ce2d15a3bb67efb3d80 # v1.0.1
- with:
- upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
- asset_path: ./latest.json
- asset_name: latest.json
- asset_content_type: text/json
\ No newline at end of file
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: gh release upload "${{ github.ref_name }}" latest.json --clobber
\ No newline at end of file
diff --git a/.github/workflows/template-tauri-build-windows-arm64.yml b/.github/workflows/template-tauri-build-windows-arm64.yml
index 1c14496d6..6fff19b8c 100644
--- a/.github/workflows/template-tauri-build-windows-arm64.yml
+++ b/.github/workflows/template-tauri-build-windows-arm64.yml
@@ -113,21 +113,15 @@ on:
the vulkan feature -- and the SDK requirement -- to any vendor build
whether or not the variant named it. Set to 1 with cuda13-vulkan.
- # Pre-merge hook: workflow_dispatch is not offered until the file is on the
- # default branch, so until this merges a push is the only way to exercise it.
- # Drop this once it lands there.
- push:
- branches: ['feat/windows-arm64']
-
# Don't spend 3h of ARM runner on a superseded commit, and concurrent CUDA pulls
# get throttled. Keyed on the caller's ref so nightly and a feature branch don't
-# evict each other. x64 needs none of this; only this one takes pushes.
+# evict each other.
concurrency:
group: tauri-win-arm64-${{ github.ref }}
cancel-in-progress: true
env:
- # `||` defaults because a push carries no inputs at all.
+ # `||` defaults for a run that carries no inputs.
CHANNEL: ${{ inputs.channel || 'nightly' }}
NEW_VERSION: ${{ inputs.new_version || '0.0.0' }}
JAN_ENGINE_VARIANT: ${{ inputs.engine_variant || 'cuda13' }}
@@ -503,10 +497,10 @@ jobs:
JAN_SIGNING_KEY: ${{ secrets.JAN_SIGNING_KEY }}
# Only after a miss, and only when the job builds main or a release tag
- # itself: PR runs (github.ref refs/pull/N/merge) and this file's own
- # branch push read the cache but never write it, and neither does a
- # caller on main that builds another ref. `!cancelled()` rather than
- # success() so the engine is kept when signing or bundling fails later;
+ # itself: PR runs (github.ref refs/pull/N/merge) read the cache but never
+ # write it, and neither does a caller on main that builds another ref.
+ # `!cancelled()` rather than success() so the engine is kept when signing
+ # or bundling fails later;
# the script itself refuses unless the worker was built and every output
# is present.
- name: Save the prebuilt llama.cpp engine