mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-10-08 02:37:46 +08:00
The canvas now fills the window and the chat floats on its right. draw.io is served from our own origin (public/drawio, downloaded at build time and checked against the release's SHA-256), so the app can drive the editor directly: - every AI change becomes a version card with a thumbnail; compare, restore or undo it, and Ctrl+Z on the canvas takes an AI change back in one step - shapes the AI just changed are highlighted on the canvas - selected shapes appear as a chip and are sent to the model - the app's own canvas toolbar, shape library and page tabs replace draw.io's chrome - new start screen, session rename and switcher, open .drawio files - settings split into Models & keys, Appearance, Advanced and About - phones switch between canvas and chat - dark mode keeps the diagram on a white sheet and no longer flashes With an external draw.io (NEXT_PUBLIC_DRAWIO_BASE_URL) the app falls back to draw.io's own toolbar and the features above that need same origin are off. The chat logic moved from the 1500-line chat panel into a chat engine plus small UI components; zustand holds canvas, versions, settings and UI state.
103 lines
2.7 KiB
YAML
103 lines
2.7 KiB
YAML
name: Electron Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: "Version tag (e.g., v0.4.5)"
|
|
required: false
|
|
|
|
jobs:
|
|
# Mac and Linux: Build and publish directly (no signing needed)
|
|
build-mac-linux:
|
|
permissions:
|
|
contents: write
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: macos-latest
|
|
platform: mac
|
|
- os: ubuntu-latest
|
|
platform: linux
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 24
|
|
cache: "npm"
|
|
|
|
# The download script reads .env files with @next/env
|
|
- name: Install dependencies
|
|
run: npm install
|
|
|
|
- name: Download draw.io static files for offline use
|
|
run: node scripts/fetch-drawio.mjs
|
|
|
|
- name: Build and publish
|
|
run: npm run dist:${{ matrix.platform }}
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# Windows: Build, sign with SignPath, then publish
|
|
build-windows:
|
|
permissions:
|
|
contents: write
|
|
runs-on: windows-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 24
|
|
cache: "npm"
|
|
|
|
# The download script reads .env files with @next/env
|
|
- name: Install dependencies
|
|
run: npm install
|
|
|
|
- name: Download draw.io static files for offline use
|
|
run: node scripts/fetch-drawio.mjs
|
|
|
|
# Build WITHOUT publishing
|
|
- name: Build Windows app
|
|
run: npm run dist:win:build
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Upload unsigned artifacts for signing
|
|
uses: actions/upload-artifact@v6
|
|
id: upload-unsigned
|
|
with:
|
|
name: windows-unsigned
|
|
path: release/*.exe
|
|
retention-days: 1
|
|
|
|
- name: Sign with SignPath
|
|
uses: signpath/github-action-submit-signing-request@v2
|
|
with:
|
|
api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
|
|
organization-id: '880a211d-2cd3-4e7b-8d04-3d1f8eb39df5'
|
|
project-slug: 'next-ai-draw-io'
|
|
signing-policy-slug: 'release-signing'
|
|
artifact-configuration-slug: 'windows-exe'
|
|
github-artifact-id: ${{ steps.upload-unsigned.outputs.artifact-id }}
|
|
wait-for-completion: true
|
|
output-artifact-directory: release-signed
|
|
|
|
- name: Upload signed artifacts to release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: release-signed/*.exe
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|