- 新增标签管理: 列表/创建/删除/推送标签 (后端API + 前端UI) - 前端新增标签Tab页,支持创建、删除、推送操作 - config.go 改为从可执行文件同目录加载 config.yaml - 各平台构建脚本自动复制 config.yaml 到输出目录 - Windows 打包改为 ZIP 格式 (不依赖 NSIS) - 新增 GitHub Actions Release 工作流 (三平台自动构建+发布)
213 lines
5.9 KiB
YAML
213 lines
5.9 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build-windows:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24'
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install Wails CLI
|
|
run: go install github.com/wailsapp/wails/v3/cmd/wails3@latest
|
|
|
|
- name: Install frontend dependencies
|
|
run: npm install
|
|
working-directory: frontend
|
|
|
|
- name: Build frontend
|
|
run: npm run generate
|
|
working-directory: frontend
|
|
|
|
- name: Generate bindings
|
|
run: wails3 generate bindings
|
|
|
|
- name: Generate icons
|
|
run: wails3 generate icons -input build/appicon.png -windowsDir build/windows -macDir build/darwin
|
|
|
|
- name: Generate syso
|
|
working-directory: build
|
|
run: wails3 generate syso -arch amd64 -icon windows/icon.ico -manifest windows/wails.exe.manifest -info windows/info.json -out ../wails_windows_amd64.syso
|
|
|
|
- name: Build
|
|
env:
|
|
CGO_ENABLED: 1
|
|
GOOS: windows
|
|
GOARCH: amd64
|
|
run: go build -tags production -trimpath -buildvcs=false -ldflags="-w -s -H windowsgui" -o bin/gitpilot.exe
|
|
|
|
- name: Copy config.yaml
|
|
run: Copy-Item config.yaml -Destination bin/config.yaml
|
|
|
|
- name: Remove syso
|
|
run: Remove-Item *.syso
|
|
|
|
- name: Package
|
|
run: Compress-Archive -Path "bin/gitpilot.exe","bin/config.yaml" -DestinationPath "bin/gitpilot-windows-amd64.zip" -Force
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: gitpilot-windows-amd64
|
|
path: bin/gitpilot-windows-amd64.zip
|
|
|
|
build-macos:
|
|
runs-on: macos-latest
|
|
strategy:
|
|
matrix:
|
|
arch: [amd64, arm64]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24'
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install Wails CLI
|
|
run: go install github.com/wailsapp/wails/v3/cmd/wails3@latest
|
|
|
|
- name: Install frontend dependencies
|
|
run: npm install
|
|
working-directory: frontend
|
|
|
|
- name: Build frontend
|
|
run: npm run generate
|
|
working-directory: frontend
|
|
|
|
- name: Generate bindings
|
|
run: wails3 generate bindings
|
|
|
|
- name: Generate icons
|
|
run: wails3 generate icons -input build/appicon.png -windowsDir build/windows -macDir build/darwin
|
|
|
|
- name: Build
|
|
env:
|
|
CGO_ENABLED: 1
|
|
GOOS: darwin
|
|
GOARCH: ${{ matrix.arch }}
|
|
CGO_CFLAGS: "-mmacosx-version-min=10.15"
|
|
CGO_LDFLAGS: "-mmacosx-version-min=10.15"
|
|
MACOSX_DEPLOYMENT_TARGET: "10.15"
|
|
run: go build -tags "production,disable_onnx" -trimpath -buildvcs=false -ldflags="-w -s" -o bin/gitpilot
|
|
|
|
- name: Create .app bundle
|
|
run: |
|
|
mkdir -p bin/gitpilot.app/Contents/{MacOS,Resources}
|
|
cp build/darwin/icons.icns bin/gitpilot.app/Contents/Resources/
|
|
cp bin/gitpilot bin/gitpilot.app/Contents/MacOS/
|
|
cp config.yaml bin/gitpilot.app/Contents/MacOS/config.yaml
|
|
cp build/darwin/Info.plist bin/gitpilot.app/Contents/
|
|
codesign --force --deep --sign - bin/gitpilot.app
|
|
|
|
- name: Package
|
|
run: |
|
|
cd bin
|
|
zip -r gitpilot-macos-${{ matrix.arch }}.zip gitpilot.app config.yaml
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: gitpilot-macos-${{ matrix.arch }}
|
|
path: bin/gitpilot-macos-${{ matrix.arch }}.zip
|
|
|
|
build-linux:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24'
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev
|
|
|
|
- name: Install Wails CLI
|
|
run: go install github.com/wailsapp/wails/v3/cmd/wails3@latest
|
|
|
|
- name: Install frontend dependencies
|
|
run: npm install
|
|
working-directory: frontend
|
|
|
|
- name: Build frontend
|
|
run: npm run generate
|
|
working-directory: frontend
|
|
|
|
- name: Generate bindings
|
|
run: wails3 generate bindings
|
|
|
|
- name: Generate icons
|
|
run: wails3 generate icons -input build/appicon.png -windowsDir build/windows -macDir build/darwin
|
|
|
|
- name: Build
|
|
env:
|
|
CGO_ENABLED: 1
|
|
GOOS: linux
|
|
GOARCH: amd64
|
|
run: go build -tags "production,disable_onnx" -trimpath -buildvcs=false -ldflags="-w -s" -o bin/gitpilot
|
|
|
|
- name: Copy config.yaml
|
|
run: cp config.yaml bin/config.yaml
|
|
|
|
- name: Package
|
|
run: |
|
|
cd bin
|
|
tar czf gitpilot-linux-amd64.tar.gz gitpilot config.yaml
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: gitpilot-linux-amd64
|
|
path: bin/gitpilot-linux-amd64.tar.gz
|
|
|
|
release:
|
|
needs: [build-windows, build-macos, build-linux]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
generate_release_notes: true
|
|
files: |
|
|
artifacts/gitpilot-windows-amd64/gitpilot-windows-amd64.zip
|
|
artifacts/gitpilot-macos-amd64/gitpilot-macos-amd64.zip
|
|
artifacts/gitpilot-macos-arm64/gitpilot-macos-arm64.zip
|
|
artifacts/gitpilot-linux-amd64/gitpilot-linux-amd64.tar.gz
|