alpha.yml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. name: Alpha Build
  2. on:
  3. workflow_dispatch:
  4. push:
  5. branches: [main]
  6. tags-ignore: [updater, alpha]
  7. permissions: write-all
  8. env:
  9. CARGO_INCREMENTAL: 0
  10. RUST_BACKTRACE: short
  11. jobs:
  12. alpha:
  13. strategy:
  14. fail-fast: false
  15. matrix:
  16. include:
  17. - os: windows-latest
  18. target: x86_64-pc-windows-msvc
  19. - os: windows-latest
  20. target: aarch64-pc-windows-msvc
  21. - os: macos-latest
  22. target: aarch64-apple-darwin
  23. - os: macos-latest
  24. target: x86_64-apple-darwin
  25. runs-on: ${{ matrix.os }}
  26. steps:
  27. - name: Checkout Repository
  28. uses: actions/checkout@v4
  29. - name: Install Rust Stable
  30. uses: dtolnay/rust-toolchain@stable
  31. - name: Add Rust Target
  32. run: rustup target add ${{ matrix.target }}
  33. - name: Rust Cache
  34. uses: Swatinem/rust-cache@v2
  35. with:
  36. workspaces: src-tauri
  37. - name: Install Node
  38. uses: actions/setup-node@v4
  39. with:
  40. node-version: "20"
  41. - uses: pnpm/action-setup@v3
  42. name: Install pnpm
  43. with:
  44. version: 9
  45. run_install: false
  46. - name: Pnpm install and check
  47. run: |
  48. pnpm i
  49. pnpm check ${{ matrix.target }}
  50. - name: Tauri build
  51. uses: tauri-apps/tauri-action@v0
  52. env:
  53. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  54. TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
  55. TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
  56. with:
  57. tagName: alpha
  58. releaseName: "Clash Verge Rev Alpha"
  59. releaseBody: "More new features are now supported."
  60. releaseDraft: false
  61. prerelease: true
  62. tauriScript: pnpm
  63. args: --target ${{ matrix.target }}
  64. - name: Portable Bundle
  65. if: matrix.os == 'windows-latest'
  66. run: pnpm portable ${{ matrix.target }} --alpha
  67. env:
  68. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  69. TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
  70. TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
  71. alpha-for-linux:
  72. strategy:
  73. fail-fast: false
  74. matrix:
  75. include:
  76. - os: ubuntu-latest
  77. target: x86_64-unknown-linux-gnu
  78. - os: ubuntu-latest
  79. target: aarch64-unknown-linux-gnu
  80. - os: ubuntu-latest
  81. target: armv7-unknown-linux-gnueabihf
  82. runs-on: ${{ matrix.os }}
  83. steps:
  84. - name: Checkout Repository
  85. uses: actions/checkout@v4
  86. - name: Build for Linux
  87. uses: ./.github/build-for-linux
  88. env:
  89. TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
  90. TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
  91. with:
  92. target: ${{ matrix.target }}
  93. - name: Get Version
  94. run: |
  95. sudo apt-get update
  96. sudo apt-get install jq
  97. echo "VERSION=$(cat package.json | jq '.version' | tr -d '"')" >> $GITHUB_ENV
  98. echo "BUILDTIME=$(TZ=Asia/Shanghai date)" >> $GITHUB_ENV
  99. - run: |
  100. cat > release.txt << 'EOF'
  101. ### 我应该下载哪个版本?
  102. - Windows x86_64架构: x64-setup.exe (不支持win7)
  103. - Windows arm64架构: arm64-setup.exe
  104. - MacOS intel芯片: x64.dmg
  105. - MacOS apple M芯片: aarch64.dmg (提示文件损坏看下面FAQ)
  106. - Linux x64架构: amd64.AppImage/amd64.deb
  107. - Linux arm64架构: arm64.deb
  108. - Linux armv7架构: armhf.deb
  109. - Windows 便携板 x86_64架构: x64_portable.zip (不推荐使用,无法自动更新)
  110. - Windows 便携板 arm64架构: arm64_portable.zip (不推荐使用,无法自动更新)
  111. ### FAQ
  112. - [FAQ](https://clash-verge-rev.github.io/faq/install/)
  113. Created at ${{ env.BUILDTIME }}.
  114. EOF
  115. - name: Upload Release
  116. if: startsWith(matrix.target, 'x86_64')
  117. uses: softprops/action-gh-release@v1
  118. with:
  119. tag_name: alpha
  120. name: "Clash Verge Rev Alpha"
  121. body_path: release.txt
  122. prerelease: true
  123. token: ${{ secrets.GITHUB_TOKEN }}
  124. files: src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage*
  125. - name: Upload Release
  126. uses: softprops/action-gh-release@v1
  127. with:
  128. tag_name: alpha
  129. name: "Clash Verge Rev Alpha"
  130. body_path: release.txt
  131. prerelease: true
  132. token: ${{ secrets.GITHUB_TOKEN }}
  133. files: src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb
  134. update_tag:
  135. name: Update tag
  136. runs-on: ubuntu-latest
  137. needs: [alpha, alpha-for-linux]
  138. steps:
  139. - name: Checkout repository
  140. uses: actions/checkout@v4
  141. - name: Set Env
  142. run: |
  143. echo "BUILDTIME=$(TZ=Asia/Shanghai date)" >> $GITHUB_ENV
  144. shell: bash
  145. - name: Update Tag
  146. uses: richardsimko/update-tag@v1
  147. with:
  148. tag_name: alpha
  149. env:
  150. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  151. - run: |
  152. cat > release.txt << 'EOF'
  153. ### 我应该下载哪个版本?
  154. - Windows x86_64架构: x64-setup.exe (不支持win7)
  155. - Windows arm64架构: arm64-setup.exe
  156. - MacOS intel芯片: x64.dmg
  157. - MacOS apple M芯片: aarch64.dmg (提示文件损坏看下面FAQ)
  158. - Linux x64架构: amd64.AppImage/amd64.deb
  159. - Linux arm64架构: arm64.deb
  160. - Linux armv7架构: armhf.deb
  161. - Windows 便携板 x86_64架构: x64_portable.zip (不推荐使用,无法自动更新)
  162. - Windows 便携板 arm64架构: arm64_portable.zip (不推荐使用,无法自动更新)
  163. ### FAQ
  164. - [FAQ](https://clash-verge-rev.github.io/faq/install/)
  165. Created at ${{ env.BUILDTIME }}.
  166. EOF
  167. - name: Upload Release
  168. uses: softprops/action-gh-release@v1
  169. with:
  170. tag_name: alpha
  171. name: "Clash Verge Rev Alpha"
  172. body_path: release.txt
  173. prerelease: true
  174. token: ${{ secrets.GITHUB_TOKEN }}
  175. generate_release_notes: true