|
|
@@ -6,54 +6,8 @@ on:
|
|
|
- 'v*'
|
|
|
|
|
|
jobs:
|
|
|
- # 第一步:类型检查、更新版本号并提交
|
|
|
- update-version:
|
|
|
- runs-on: ubuntu-latest
|
|
|
- outputs:
|
|
|
- version: ${{ steps.version.outputs.VERSION }}
|
|
|
-
|
|
|
- steps:
|
|
|
- - name: Checkout code
|
|
|
- uses: actions/checkout@v4
|
|
|
-
|
|
|
- - name: Setup Node.js
|
|
|
- uses: actions/setup-node@v4
|
|
|
- with:
|
|
|
- node-version: '20'
|
|
|
- cache: 'npm'
|
|
|
-
|
|
|
- - name: Install dependencies
|
|
|
- run: npm ci
|
|
|
-
|
|
|
- - name: Type check
|
|
|
- run: npm run typecheck
|
|
|
-
|
|
|
- - name: Extract version from tag
|
|
|
- id: version
|
|
|
- run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
|
|
-
|
|
|
- - name: Update version in all config files
|
|
|
- run: |
|
|
|
- # Update package.json
|
|
|
- npm pkg set version=${{ steps.version.outputs.VERSION }}
|
|
|
-
|
|
|
- # Update Cargo.toml
|
|
|
- sed -i 's/^version = ".*"/version = "${{ steps.version.outputs.VERSION }}"/' src-tauri/Cargo.toml
|
|
|
-
|
|
|
- # Update tauri.conf.json
|
|
|
- sed -i 's/"version": ".*"/"version": "${{ steps.version.outputs.VERSION }}"/' src-tauri/tauri.conf.json
|
|
|
-
|
|
|
- - name: Commit version update
|
|
|
- run: |
|
|
|
- git config user.name "github-actions[bot]"
|
|
|
- git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
|
- git add package.json src-tauri/Cargo.toml src-tauri/tauri.conf.json
|
|
|
- git commit -m "chore: bump version to ${{ steps.version.outputs.VERSION }}" || echo "No changes to commit"
|
|
|
- git push origin HEAD:main
|
|
|
-
|
|
|
- # 第二步:并行构建所有平台
|
|
|
+ # 第一步:并行构建所有平台
|
|
|
build:
|
|
|
- needs: update-version
|
|
|
strategy:
|
|
|
fail-fast: false
|
|
|
matrix:
|
|
|
@@ -76,8 +30,6 @@ jobs:
|
|
|
steps:
|
|
|
- name: Checkout code
|
|
|
uses: actions/checkout@v4
|
|
|
- with:
|
|
|
- ref: main
|
|
|
|
|
|
- name: Setup Node.js
|
|
|
uses: actions/setup-node@v4
|
|
|
@@ -109,11 +61,10 @@ jobs:
|
|
|
sudo apt-get update
|
|
|
sudo apt-get install -y \
|
|
|
libwebkit2gtk-4.1-dev \
|
|
|
- libappindicator3-dev \
|
|
|
+ libayatana-appindicator3-dev \
|
|
|
librsvg2-dev \
|
|
|
patchelf \
|
|
|
- libgtk-3-dev \
|
|
|
- libayatana-appindicator3-dev
|
|
|
+ libgtk-3-dev
|
|
|
|
|
|
- name: Install dependencies
|
|
|
run: npm ci
|
|
|
@@ -141,9 +92,9 @@ jobs:
|
|
|
path: built/*
|
|
|
if-no-files-found: error
|
|
|
|
|
|
- # 第三步:创建 Release 并上传所有产物
|
|
|
+ # 第二步:创建 Release 并上传所有产物
|
|
|
release:
|
|
|
- needs: [update-version, build]
|
|
|
+ needs: build
|
|
|
runs-on: ubuntu-latest
|
|
|
permissions:
|
|
|
contents: write
|
|
|
@@ -162,8 +113,6 @@ jobs:
|
|
|
- name: Create Release
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
with:
|
|
|
- tag_name: v${{ needs.update-version.outputs.version }}
|
|
|
- name: 'Claude AI Installer v${{ needs.update-version.outputs.version }}'
|
|
|
body: |
|
|
|
## Downloads
|
|
|
|