Files
MyGoNavi/.github/workflows/release.yml
杨国锋 4099796c88 feat(connection): 增强连接管理与交互体验
- 新增测试连接功能,修复底层驱动假成功问题,确保密码/端口验证准确
- 支持导入/导出连接配置(JSON),便于迁移与备份
- 优化侧边栏:实现虚拟滚动解决卡顿,增加数据库筛选与断开连接重连机制
- 优化交互:改进右键菜单体验(全行触发/禁用选文),完善新建查询的上下文自动关联
- 界面调整:精简连接弹窗,移除冗余的默认数据库输入
2026-02-02 16:33:11 +08:00

126 lines
3.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build-and-release:
name: Build ${{ matrix.platform }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
platform: darwin/amd64
artifact_name: GoNavi-mac-amd64
- os: macos-latest
platform: darwin/arm64
artifact_name: GoNavi-mac-arm64
- os: windows-latest
platform: windows/amd64
artifact_name: GoNavi-windows-amd64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
check-latest: true
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Wails
run: go install -v github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Build
shell: bash
run: |
wails build -platform ${{ matrix.platform }} -clean -o ${{ matrix.artifact_name }}
- name: Package macOS Application
if: contains(matrix.platform, 'darwin')
run: |
# Install create-dmg
brew install create-dmg
cd build/bin
echo "📂 列出 build/bin 目录内容:"
ls -F
# Find .app bundle
APP_PATH=$(find . -maxdepth 1 -name "*.app" | head -n 1)
if [ -z "$APP_NAME" ]; then
echo "❌ 未找到 .app 应用包!"
exit 1
fi
# Ad-hoc codesign to prevent "Damaged" error (requires user to allow anyway, but valid structure)
echo "🔏 正在进行 Ad-hoc 签名..."
codesign --force --options runtime --deep --sign - "$APP_NAME"
DMG_NAME="${{ matrix.artifact_name }}.dmg"
echo "📦 正在生成 DMG: $DMG_NAME..."
# Create DMG
create-dmg \
--volname "GoNavi Installer" \
--window-pos 200 120 \
--window-size 800 400 \
--icon-size 100 \
--icon "$APP_NAME" 200 190 \
--hide-extension "$APP_NAME" \
--app-drop-link 600 185 \
"$DMG_NAME" \
"$APP_NAME"
# Move DMG to root for upload
mv "$DMG_NAME" "../../$DMG_NAME"
- name: Package Windows Executable
if: contains(matrix.platform, 'windows')
shell: bash
run: |
cd build/bin
echo "📂 列出 build/bin 目录内容:"
ls -F
TARGET="${{ matrix.artifact_name }}"
if [ -f "$TARGET.exe" ]; then
echo "✅ 找到 $TARGET.exe"
FINAL_EXE="$TARGET.exe"
elif [ -f "$TARGET" ]; then
echo "⚠️ 找到无后缀文件 $TARGET正在添加 .exe 后缀..."
mv "$TARGET" "$TARGET.exe"
FINAL_EXE="$TARGET.exe"
else
echo "❌ 未找到构建产物 '$TARGET'!"
exit 1
fi
echo "📦 正在移动 $FINAL_EXE 到根目录..."
mv "$FINAL_EXE" "../../${{ matrix.artifact_name }}.exe"
- name: Upload Release Asset
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ matrix.artifact_name }}.dmg
${{ matrix.artifact_name }}.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}