Skip to content

fix(login): auth1 429 退避重试,避免批量导入时 windsurf.com 限速误杀 #7

fix(login): auth1 429 退避重试,避免批量导入时 windsurf.com 限速误杀

fix(login): auth1 429 退避重试,避免批量导入时 windsurf.com 限速误杀 #7

Workflow file for this run

name: Release Cross Platform
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
env:
GO_VERSION: '1.24.5'
NODE_VERSION: '20'
WAILS_VERSION: '2.11.0'
jobs:
build:
name: Build ${{ matrix.label }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
label: windows-amd64
platform: windows/amd64
artifact_name: windsurf-tools-wails-windows-amd64
- os: macos-15-intel
label: macos-intel-amd64
platform: darwin/amd64
artifact_name: windsurf-tools-wails-macos-intel-amd64
- os: macos-15
label: macos-apple-silicon-arm64
platform: darwin/arm64
artifact_name: windsurf-tools-wails-macos-apple-silicon-arm64
- os: ubuntu-24.04
label: linux-amd64
platform: linux/amd64
artifact_name: windsurf-tools-wails-linux-amd64
webkit_pkg: libwebkit2gtk-4.1-dev
build_tags: webkit2_41
- os: ubuntu-22.04
label: linux-amd64-legacy
platform: linux/amd64
artifact_name: windsurf-tools-wails-linux-amd64-legacy
webkit_pkg: libwebkit2gtk-4.0-dev
build_tags: webkit2_40
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Linux — install WebKit / GTK headers
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-3-dev \
${{ matrix.webkit_pkg }} \
build-essential \
pkg-config
- name: Add Go bin to PATH (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
"$(go env GOPATH)/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Add Go bin to PATH (Unix)
if: runner.os != 'Windows'
shell: bash
run: echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
- name: Install Wails CLI
run: go install github.com/wailsapp/wails/v2/cmd/wails@v${{ env.WAILS_VERSION }}
- name: Frontend install
working-directory: frontend
run: npm ci
- name: Wails build
shell: bash
run: |
if [ -n "${{ matrix.build_tags }}" ]; then
wails build -platform ${{ matrix.platform }} -tags ${{ matrix.build_tags }}
else
wails build -platform ${{ matrix.platform }}
fi
- name: Package Windows artifacts
if: runner.os == 'Windows'
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path dist | Out-Null
Copy-Item -Force "build/bin/windsurf-tools-wails.exe" "dist/windsurf-tools-wails.exe"
Compress-Archive -Path "dist/windsurf-tools-wails.exe" -DestinationPath "dist/windsurf-tools-wails-windows-amd64.zip" -Force
Get-ChildItem dist | Format-Table Name, Length
- name: Package macOS artifacts (zip + dmg for arm64)
if: runner.os == 'macOS'
shell: bash
run: |
set -euo pipefail
mkdir -p dist
if [ ! -d "build/bin/windsurf-tools-wails.app" ]; then
echo "Missing build/bin/windsurf-tools-wails.app"
exit 1
fi
ditto -c -k --keepParent "build/bin/windsurf-tools-wails.app" "dist/${{ matrix.artifact_name }}.zip"
# 额外为 Apple Silicon 生成 DMG(用户更习惯的安装格式)
if [ "${{ matrix.platform }}" = "darwin/arm64" ] && [ -f "build/darwin/build-dmg.sh" ]; then
bash build/darwin/build-dmg.sh || echo "DMG build skipped (script failed)"
if ls build/bin/*.dmg >/dev/null 2>&1; then
cp build/bin/*.dmg "dist/WindsurfTools-apple-silicon-arm64.dmg"
fi
fi
ls -lh dist
- name: Package Linux artifacts
if: runner.os == 'Linux'
shell: bash
run: |
set -euo pipefail
mkdir -p dist
BIN="build/bin/windsurf-tools-wails"
if [ ! -f "$BIN" ]; then
echo "Missing $BIN"
exit 1
fi
chmod +x "$BIN"
cp "$BIN" "dist/${{ matrix.artifact_name }}"
tar -C build/bin -czf "dist/${{ matrix.artifact_name }}.tar.gz" windsurf-tools-wails
ls -lh dist
- name: Upload packaged artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: dist/*
if-no-files-found: error
release:
name: Publish GitHub Release
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download packaged artifacts
uses: actions/download-artifact@v4
with:
path: dist
pattern: windsurf-tools-wails-*
merge-multiple: true
- name: Generate SHA256SUMS
shell: bash
run: |
set -euo pipefail
cd dist
sha256sum * > SHA256SUMS.txt
ls -lh
- name: Upload to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
dist/windsurf-tools-wails.exe
dist/windsurf-tools-wails-windows-amd64.zip
dist/windsurf-tools-wails-macos-intel-amd64.zip
dist/windsurf-tools-wails-macos-apple-silicon-arm64.zip
dist/WindsurfTools-apple-silicon-arm64.dmg
dist/windsurf-tools-wails-linux-amd64
dist/windsurf-tools-wails-linux-amd64.tar.gz
dist/windsurf-tools-wails-linux-amd64-legacy
dist/windsurf-tools-wails-linux-amd64-legacy.tar.gz
dist/SHA256SUMS.txt
fail_on_unmatched_files: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}