Merge pull request #38 from ZhangXiChang/branch-1 #22
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 发布 | |
| on: | |
| push: | |
| tags: [v*.*.*] | |
| jobs: | |
| verify: | |
| name: 验证版本签名 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: 验证 Tag 签名 | |
| run: | | |
| git verify-tag ${GITHUB_REF#refs/tags/} || { | |
| echo "❌ 版本签名无效或缺失" | |
| exit 1 | |
| } | |
| web: | |
| needs: verify | |
| name: 发布到Web | |
| runs-on: ubuntu-latest | |
| steps: | |
| #环境依赖 | |
| - uses: actions/checkout@v5 | |
| - uses: cargo-bins/cargo-binstall@main | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| #执行流程 | |
| - name: 安装wasm32-unknown-unknown | |
| run: rustup target install wasm32-unknown-unknown | |
| - name: 安装wasm-pack | |
| run: cargo binstall wasm-pack | |
| - name: 构建依赖包 | |
| run: bun run build:deps | |
| - name: 安装依赖包 | |
| run: bun install | |
| - name: 构建 | |
| run: bun run build | |
| #发布 | |
| - name: 发布 | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| wranglerVersion: latest | |
| packageManager: bun | |
| accountId: ${{secrets.CLOUDFLARE_ACCOUNT_ID}} | |
| apiToken: ${{secrets.CLOUDFLARE_API_TOKEN}} | |
| windows: | |
| needs: verify | |
| name: 发布到Windows | |
| runs-on: windows-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| #环境依赖 | |
| - uses: actions/checkout@v5 | |
| - uses: cargo-bins/cargo-binstall@main | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| #执行流程 | |
| - name: 安装wasm32-unknown-unknown | |
| run: rustup target install wasm32-unknown-unknown | |
| - name: 安装wasm-pack | |
| run: cargo binstall wasm-pack | |
| - name: 构建依赖包 | |
| run: bun run build:deps | |
| - name: 安装依赖包 | |
| run: bun install | |
| - name: 生成应用图标资源 | |
| run: bun tauri icon public/icon.svg | |
| - name: 构建 | |
| run: bun tauri build | |
| #发布 | |
| - name: 后处理构建产物 | |
| run: | | |
| $TARGET_PATH="target/release/starlink-windows.exe" | |
| echo "TARGET_PATH=$TARGET_PATH" >> $env:GITHUB_ENV | |
| Move-Item -Path target/release/native.exe -Destination $TARGET_PATH | |
| - name: 发布 | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| with: | |
| files: ${{env.TARGET_PATH}} |