Skip to content

0.5.29 - [new] mimo模型升级 #98

0.5.29 - [new] mimo模型升级

0.5.29 - [new] mimo模型升级 #98

Workflow file for this run

# Builds the Electron desktop shell as standalone installers (.exe / .dmg).
# Independent from the npm `publish.yml` and `docker.yml` pipelines — touches
# nothing on npm/Docker.
#
# Triggers:
# - push to any branch → matrix runs (no release uploaded)
# - tag push `v*-desktop[.N]` → matrix runs AND release uploaded
# - workflow_dispatch → manual run from Actions UI
#
# Skipped intentionally:
# - win-arm64: better-sqlite3 prebuilds for win32-arm64 are unreliable for
# v12.x — a win-arm64 package bundles a wrong-arch native module and 404s on
# /admin/. Dropped at the config level too (electron-builder.yml win.target
# has no arm64; pack-desktop-local.mjs VALID_TARGETS excludes win-arm64).
# Windows-on-ARM runs the x64 build under emulation. Re-adding it requires a
# real win32-arm64 prebuild + the probe-prebuild gate.
name: build-desktop
on:
push:
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
arch: x64
target: win
sidecar_platform: win32
# Both Mac arch flavors are built on the same Apple Silicon runner.
# macos-15 → arm64 = native; macos-15 → x64 = cross-build (electron-builder
# handles this fine since 24.x). macos-13 (Intel) is intentionally NOT
# used — free-tier capacity is poor and jobs sit in the queue for hours.
# Smoke-testing the x64 build on an arm64 host is impossible, but the
# produced .dmg + .zip can be verified on any Intel Mac post-release.
# macos-14 was tried first — its hdiutil produced UDZO dmg files that
# passed SHA verification but failed to mount on consumer Macs ("此电脑
# 不能读取你连接的磁盘"). macos-15 has a newer hdiutil that doesn't
# exhibit this bug; combined with electron-builder.yml `format: ULFO`
# the resulting dmg mounts reliably.
- os: macos-15
arch: x64
target: mac
sidecar_platform: darwin
- os: macos-15
arch: arm64
target: mac
sidecar_platform: darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Install root deps
run: npm ci
- name: Install desktop deps
run: npm --prefix package/desktop install --no-audit --no-fund
- name: Generate brand icons (tray + app)
run: npm run brand:icons
- name: Build sidecar bundle (CLI + web admin + electron-ABI native modules)
env:
SIDECAR_PLATFORM: ${{ matrix.sidecar_platform }}
SIDECAR_ARCH: ${{ matrix.arch }}
run: npm run sidecar:build
- name: Build desktop main + renderer
run: npm --prefix package/desktop run build
- name: Package electron-builder
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# electron-builder uses hardlinks when caching; on GH runners with
# cached node_modules this can hit EXDEV / EPERM. Disable to be safe.
USE_HARD_LINKS: "false"
# Skip code signing (we don't have certificates yet — spec §4.5).
CSC_IDENTITY_AUTO_DISCOVERY: "false"
working-directory: package/desktop
run: npx electron-builder --${{ matrix.target }} --${{ matrix.arch }} --publish never --config electron-builder.yml
# Launch the PACKAGED app's bundled Electron as Node against the packaged
# sidecar and assert /admin/api/health → adminEnabled:true. Catches the
# wrong-arch / wrong-ABI / unsigned-.node class that the pre-package smoke
# test can't see (the mac-arm64 "/admin/ 404" regression). Self-skips for
# the mac-x64 cross-build (can't run an x64 app on the arm64 runner), so
# that artifact must still be validated on a real Intel Mac before relying
# on it. Hard-fails the job on a broken native artifact.
- name: Post-package health check (native target)
shell: bash
run: node scripts/postpack-healthcheck.mjs "${{ matrix.sidecar_platform }}" "${{ matrix.arch }}"
- name: List release directory
if: always()
shell: bash
working-directory: package/desktop/release
run: |
ls -lah
# Hard-fail if electron-builder exited 0 but produced nothing.
# Without this we'd silently upload an empty artifact and the
# release job would be missing this row.
# Mac ships zip only (dmg target was dropped — see electron-builder.yml).
# If a future dmg is added manually via `gh release upload`, it's
# accepted in the download page but not produced here.
shopt -s nullglob
files=( *.zip *.exe )
if [ ${#files[@]} -eq 0 ]; then
echo "::error::release/ is empty — electron-builder produced no installer"
exit 1
fi
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: mimo2codex-desktop-${{ matrix.target }}-${{ matrix.arch }}
# Multi-line globs — brace expansion (*.{zip,exe}) isn't reliably
# honored by @actions/glob across runner versions; multi-line list
# works everywhere. Each matrix job runs in a fresh runner with
# its own release/ dir, so cross-arch contamination isn't possible.
path: |
package/desktop/release/*.zip
package/desktop/release/*.exe
if-no-files-found: error
retention-days: 14
release:
needs: build
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-desktop')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: List artifacts
shell: bash
run: ls -lah artifacts
- name: Compute SHA256 sums
shell: bash
working-directory: artifacts
run: |
: > SHA256SUMS.txt
# Mac ships zip only; .dmg is listed defensively in case a maintainer
# uploaded one manually before this job runs (rare).
for f in *.exe *.zip *.dmg; do
[ -f "$f" ] || continue
sha=$(sha256sum "$f" | awk '{print $1}')
printf "%s %s\n" "$sha" "$f" >> SHA256SUMS.txt
done
cat SHA256SUMS.txt
- name: Assemble release body
shell: bash
run: |
{
echo "## Desktop builds"
echo ""
echo "| Platform | Arch | File | SHA256 |"
echo "|----------|-------|------|--------|"
for f in artifacts/*.exe artifacts/*.zip artifacts/*.dmg; do
[ -f "$f" ] || continue
base=$(basename "$f")
sha=$(grep -F " $base" artifacts/SHA256SUMS.txt | awk '{print $1}')
case "$base" in
*win-x64*) platform="Windows"; arch="x64";;
*win-arm64*) platform="Windows"; arch="arm64";;
*mac-x64*) platform="macOS"; arch="x64";;
*mac-arm64*) platform="macOS"; arch="arm64";;
*) platform="?"; arch="?";;
esac
echo "| $platform | $arch | \`$base\` | \`$sha\` |"
done
echo ""
echo "---"
echo ""
echo "📖 **Install & verification guide:** [mimodoc.chengj.online/download](https://mimodoc.chengj.online/download)"
echo ""
echo "macOS ships as \`.zip\` — Finder unzips on double-click; drag \`mimo2codex.app\` to \`/Applications\` and run \`xattr -cr /Applications/mimo2codex.app\` once to clear the download quarantine flag."
echo ""
echo "Prefer the command line? \`npm install -g mimo2codex\` — same proxy, no tray."
} > release-body.md
cat release-body.md
- name: Create release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/*.exe
artifacts/*.zip
artifacts/*.dmg
artifacts/SHA256SUMS.txt
body_path: release-body.md
fail_on_unmatched_files: false
# Don't mark as latest (npm releases live under unsuffixed `v*` tags).
make_latest: "false"