ci: remove TS/Electron workflows (build-electron / ci / docker / publish-cli)

Rust-ification 阶段,CI 只保留 Rust 相关:
- rust-check.yml: cargo fmt + build + test (with STEP1A_REQUIRE_GPU=1 on Linux) + clippy + cargo-deny
- wasm-bundle-check.yml: wasm32 target check

删除:
- build-electron.yml: Electron desktop build (Rust 化后用 openpencil-shell-native)
- ci.yml: TS type-check + Vitest + web build (Rust 化后已废)
- docker.yml: TS Docker image (Rust 化后重做)
- publish-cli.yml: npm packages (Rust 化后改 cargo publish)
This commit is contained in:
Kayshen-X 2026-05-05 21:21:00 +08:00
parent d9231123a7
commit 06a1abfcde
4 changed files with 0 additions and 593 deletions

View file

@ -1,281 +0,0 @@
name: Build Electron
on:
push:
branches:
- main
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
platform: mac-arm64
build_args: --mac --arm64
zig_target: aarch64-macos
- os: macos-latest
platform: mac-x64
build_args: --mac --x64
zig_target: x86_64-macos
- os: windows-latest
platform: win
build_args: --win
zig_target: x86_64-windows
- os: ubuntu-latest
platform: linux
build_args: --linux
zig_target: x86_64-linux
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: mlugg/setup-zig@v2
with:
version: 0.15.2
- name: Install dependencies
env:
OPENPENCIL_REQUIRE_AGENT_NATIVE: '1'
ZIG_TARGET: ${{ matrix.zig_target }}
run: bun install --frozen-lockfile
- name: Verify agent-native binary
shell: bash
run: |
if [ ! -f packages/agent-native/napi/agent_napi.node ]; then
echo "::error::packages/agent-native/napi/agent_napi.node missing — electron-builder would ship without it."
exit 1
fi
ls -la packages/agent-native/napi/agent_napi.node
- name: Build web (electron target)
run: bun --bun run build
env:
BUILD_TARGET: electron
- name: Compile electron
run: bun run electron:compile
- name: Compile MCP server
run: bun run mcp:compile
- name: Checkout openpencil-skill
uses: actions/checkout@v4
with:
repository: zseven-w/openpencil-skill
path: external/openpencil-skill
- name: Compile CLI
env:
SKILL_ROOT: ${{ github.workspace }}/external/openpencil-skill
run: bun run cli:compile
- name: Build Electron app
run: npx electron-builder --config apps/desktop/electron-builder.yml ${{ matrix.build_args }} --publish never
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
WIN_CSC_LINK: ${{ secrets.WIN_CSC_LINK }}
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
- name: Rename arm64 update metadata
if: matrix.platform == 'mac-arm64'
run: |
if [ -f out/release/latest-mac.yml ]; then
mv out/release/latest-mac.yml out/release/latest-mac-arm64.yml
fi
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: electron-${{ matrix.platform }}
path: |
out/release/*.dmg
out/release/*.zip
out/release/*.exe
out/release/*.AppImage
out/release/*.deb
out/release/latest*.yml
out/release/*.blockmap
!out/release/builder-debug.yml
retention-days: 30
release:
name: Create Release
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
merge-multiple: true
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
draft: false
generate_release_notes: true
files: artifacts/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
update-homebrew:
name: Update Homebrew Cask
runs-on: ubuntu-latest
needs: release
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Get version
id: version
run: echo "version=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT"
- name: Download macOS zips and compute sha256
run: |
VERSION=${{ steps.version.outputs.version }}
curl -fSL "https://github.com/zseven-w/openpencil/releases/download/v${VERSION}/OpenPencil-${VERSION}-arm64-mac.zip" -o arm64.zip
curl -fSL "https://github.com/zseven-w/openpencil/releases/download/v${VERSION}/OpenPencil-${VERSION}-x64-mac.zip" -o x64.zip
echo "SHA_ARM64=$(sha256sum arm64.zip | cut -d' ' -f1)" >> "$GITHUB_ENV"
echo "SHA_X64=$(sha256sum x64.zip | cut -d' ' -f1)" >> "$GITHUB_ENV"
- name: Checkout tap repo
uses: actions/checkout@v4
with:
repository: zseven-w/homebrew-openpencil
token: ${{ secrets.TAP_GITHUB_TOKEN }}
- name: Update cask formula
run: |
VERSION=${{ steps.version.outputs.version }}
mkdir -p Casks
cat > Casks/openpencil.rb << EOF
cask "openpencil" do
version "${VERSION}"
on_arm do
sha256 "${SHA_ARM64}"
url "https://github.com/zseven-w/openpencil/releases/download/v#{version}/OpenPencil-#{version}-arm64-mac.zip"
end
on_intel do
sha256 "${SHA_X64}"
url "https://github.com/zseven-w/openpencil/releases/download/v#{version}/OpenPencil-#{version}-x64-mac.zip"
end
name "OpenPencil"
desc "Open-source vector design tool"
homepage "https://github.com/zseven-w/openpencil"
app "OpenPencil.app"
zap trash: [
"~/Library/Application Support/OpenPencil",
"~/Library/Preferences/dev.openpencil.app.plist",
"~/Library/Caches/dev.openpencil.app",
]
end
EOF
- name: Commit and push
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add Casks/openpencil.rb
git diff --cached --quiet && exit 0
git commit -m "Update OpenPencil to ${{ steps.version.outputs.version }}"
git push
update-scoop:
name: Update Scoop Bucket
runs-on: ubuntu-latest
needs: release
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Get version
id: version
run: echo "version=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT"
- name: Download Windows portable and compute sha256
run: |
VERSION=${{ steps.version.outputs.version }}
curl -fSL "https://github.com/zseven-w/openpencil/releases/download/v${VERSION}/OpenPencil-${VERSION}-x64-win.exe" -o win64.exe
echo "SHA_WIN64=$(sha256sum win64.exe | cut -d' ' -f1)" >> "$GITHUB_ENV"
- name: Checkout scoop bucket
uses: actions/checkout@v4
with:
repository: zseven-w/scoop-openpencil
token: ${{ secrets.TAP_GITHUB_TOKEN }}
- name: Update manifest
run: |
VERSION=${{ steps.version.outputs.version }}
mkdir -p bucket
cat > bucket/openpencil.json << EOF
{
"version": "${VERSION}",
"description": "Open-source AI-native vector design tool",
"homepage": "https://github.com/zseven-w/openpencil",
"license": "MIT",
"architecture": {
"64bit": {
"url": "https://github.com/zseven-w/openpencil/releases/download/v${VERSION}/OpenPencil-${VERSION}-x64-win.exe",
"hash": "${SHA_WIN64}"
}
},
"pre_install": "Rename-Item \"\$dir\\OpenPencil-\$version-x64-win.exe\" 'OpenPencil.exe'",
"bin": "OpenPencil.exe",
"shortcuts": [["OpenPencil.exe", "OpenPencil"]],
"checkver": {
"github": "https://github.com/zseven-w/openpencil"
},
"autoupdate": {
"architecture": {
"64bit": {
"url": "https://github.com/zseven-w/openpencil/releases/download/v\$version/OpenPencil-\$version-x64-win.exe"
}
},
"pre_install": "Rename-Item \"\$dir\\OpenPencil-\$version-x64-win.exe\" 'OpenPencil.exe'"
}
}
EOF
- name: Commit and push
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add bucket/openpencil.json
git diff --cached --quiet && exit 0
git commit -m "Update OpenPencil to ${{ steps.version.outputs.version }}"
git push

View file

@ -1,104 +0,0 @@
name: CI
on:
push:
branches: [main, 'v*']
pull_request:
branches: [main]
jobs:
lint-and-test:
name: Lint & Test
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- uses: mlugg/setup-zig@v2
with:
version: 0.15.2
- name: Configure git for tests
run: |
git config --global user.name "CI"
git config --global user.email "ci@example.com"
git config --global init.defaultBranch main
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Generate skill registry
run: bun run generate
- name: Lint
run: bun run lint
- name: Format check
run: bun run format:check
- name: Checkout openpencil-skill
uses: actions/checkout@v4
with:
repository: zseven-w/openpencil-skill
path: external/openpencil-skill
- name: Bundle CLI skill
env:
SKILL_ROOT: ${{ github.workspace }}/external/openpencil-skill
run: bun run cli:bundle-skill
- name: Type check
run: npx tsc --noEmit
- name: Run tests
run: bun --bun run test
build-web:
name: Build Web
runs-on: ubuntu-latest
timeout-minutes: 10
needs: lint-and-test
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- uses: mlugg/setup-zig@v2
with:
version: 0.15.2
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build
run: bun --bun run build
- name: Checkout openpencil-skill
uses: actions/checkout@v4
with:
repository: zseven-w/openpencil-skill
path: external/openpencil-skill
- name: Build CLI
env:
SKILL_ROOT: ${{ github.workspace }}/external/openpencil-skill
run: bun run cli:compile
- name: Upload web build artifact
uses: actions/upload-artifact@v4
with:
name: web-build
path: out/web/
retention-days: 7

View file

@ -1,93 +0,0 @@
name: Docker
on:
push:
tags: ['v*']
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push:
name: Build & Push (${{ matrix.variant }})
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- variant: base
target: base
suffix: ''
platforms: linux/amd64,linux/arm64
- variant: claude
target: with-claude
suffix: '-claude'
platforms: linux/amd64,linux/arm64
- variant: codex
target: with-codex
suffix: '-codex'
platforms: linux/amd64,linux/arm64
- variant: opencode
target: with-opencode
suffix: '-opencode'
platforms: linux/amd64,linux/arm64
- variant: copilot
target: with-copilot
suffix: '-copilot'
platforms: linux/amd64,linux/arm64
- variant: gemini
target: with-gemini
suffix: '-gemini'
platforms: linux/amd64,linux/arm64
- variant: full
target: full
suffix: '-full'
platforms: linux/amd64,linux/arm64
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
suffix=${{ matrix.suffix }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
target: ${{ matrix.target }}
platforms: ${{ matrix.platforms }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.variant }}
cache-to: type=gha,mode=max,scope=${{ matrix.variant }}

View file

@ -1,115 +0,0 @@
name: Publish npm
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
- uses: mlugg/setup-zig@v2
with:
version: 0.15.2
- name: Install dependencies
env:
OPENPENCIL_SKIP_AGENT_NATIVE: '1'
run: bun install --frozen-lockfile
- name: Get version
id: version
run: echo "version=$(jq -r .version package.json)" >> "$GITHUB_OUTPUT"
- name: Replace workspace:* with version
run: |
VERSION=${{ steps.version.outputs.version }}
for f in packages/*/package.json apps/cli/package.json; do
if [ -f "$f" ]; then
jq --arg v "$VERSION" '
if .dependencies then
.dependencies |= with_entries(
if .value == "workspace:*" then .value = $v else . end
)
else . end |
if .devDependencies then
.devDependencies |= with_entries(
if .value == "workspace:*" then .value = $v else . end
)
else . end
' "$f" > "$f.tmp" && mv "$f.tmp" "$f"
echo "Updated $f"
fi
done
- name: Checkout openpencil-skill
uses: actions/checkout@v4
with:
repository: zseven-w/openpencil-skill
path: external/openpencil-skill
- name: Compile CLI
env:
SKILL_ROOT: ${{ github.workspace }}/external/openpencil-skill
run: bun run cli:compile
- name: Verify CLI build
run: node apps/cli/dist/openpencil-cli.cjs --version
# Publish in topological order. For each package:
# 1. Resolve the real name from its package.json (no hand-written
# name — avoids drift between workflow and package manifest).
# 2. Query the registry for that exact name@version. If it already
# exists, skip (idempotent re-runs of the same tag are safe).
# 3. Otherwise, publish. Real errors (auth, network, notarize, etc.)
# still fail the step because we only skip on a verified hit.
- name: Publish all packages (skip versions already on registry)
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
VERSION: ${{ steps.version.outputs.version }}
run: |
set -euo pipefail
PACKAGES=(
packages/pen-types
packages/pen-core
packages/pen-figma
packages/pen-renderer
packages/pen-engine
packages/pen-react
packages/pen-mcp
packages/pen-sdk
packages/pen-ai-skills
apps/cli
)
for dir in "${PACKAGES[@]}"; do
name=$(jq -r .name "$dir/package.json")
echo "::group::$name@$VERSION ($dir)"
if npm view "$name@$VERSION" version >/dev/null 2>&1; then
echo "✓ already on registry — skipping"
else
( cd "$dir" && npm publish --access public )
echo "✓ published"
fi
echo "::endgroup::"
done