alpha.yml 6.5 KB

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