alpha.yml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. name: Alpha Build
  2. on:
  3. workflow_dispatch:
  4. push:
  5. permissions: write-all
  6. env:
  7. CARGO_INCREMENTAL: 0
  8. RUST_BACKTRACE: short
  9. jobs:
  10. alpha:
  11. strategy:
  12. fail-fast: false
  13. matrix:
  14. include:
  15. - os: windows-latest
  16. target: x86_64-pc-windows-msvc
  17. - os: windows-latest
  18. target: aarch64-pc-windows-msvc
  19. - os: macos-latest
  20. target: aarch64-apple-darwin
  21. - os: macos-latest
  22. target: x86_64-apple-darwin
  23. runs-on: ${{ matrix.os }}
  24. steps:
  25. - name: Checkout Repository
  26. uses: actions/checkout@v4
  27. - name: Apply Patch
  28. if: matrix.target == 'aarch64-pc-windows-msvc'
  29. run: |
  30. git config --global user.email "clash-verge-rev@github.io"
  31. git config --global user.name "clash-verge-rev"
  32. git am patches/support-windows-aarch64.patch
  33. - name: Init Submodule
  34. if: matrix.target == 'aarch64-pc-windows-msvc'
  35. run: git submodule update --init --recursive
  36. - name: Install Rust Stable
  37. uses: dtolnay/rust-toolchain@stable
  38. - name: Add Rust Target
  39. run: rustup target add ${{ matrix.target }}
  40. - name: Rust Cache
  41. uses: Swatinem/rust-cache@v2
  42. with:
  43. workspaces: src-tauri
  44. - name: Install Node
  45. uses: actions/setup-node@v4
  46. with:
  47. node-version: "20"
  48. - uses: pnpm/action-setup@v2
  49. name: Install pnpm
  50. with:
  51. version: 8
  52. run_install: false
  53. - name: Pnpm install and check
  54. run: |
  55. pnpm i
  56. pnpm check ${{ matrix.target }}
  57. - name: Tauri build
  58. uses: tauri-apps/tauri-action@v0
  59. env:
  60. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  61. TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
  62. TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
  63. with:
  64. tagName: alpha
  65. releaseName: "Clash Verge Rev Alpha"
  66. releaseBody: "More new features are now supported."
  67. releaseDraft: false
  68. prerelease: true
  69. tauriScript: pnpm
  70. args: --target ${{ matrix.target }}
  71. - name: Portable Bundle
  72. if: matrix.os == 'windows-latest'
  73. run: pnpm portable ${{ matrix.target }} --alpha
  74. env:
  75. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  76. TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
  77. TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
  78. alpha-for-linux:
  79. strategy:
  80. fail-fast: false
  81. matrix:
  82. include:
  83. - os: ubuntu-latest
  84. target: x86_64-unknown-linux-gnu
  85. - os: ubuntu-latest
  86. target: aarch64-unknown-linux-gnu
  87. runs-on: ${{ matrix.os }}
  88. steps:
  89. - name: Checkout Repository
  90. uses: actions/checkout@v4
  91. - name: Build for Linux
  92. uses: ./.github/build-for-linux
  93. env:
  94. TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
  95. TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
  96. with:
  97. target: ${{ matrix.target }}
  98. - name: Get Version
  99. run: |
  100. sudo apt-get update
  101. sudo apt-get install jq
  102. echo "VERSION=$(cat package.json | jq '.version' | tr -d '"')" >> $GITHUB_ENV
  103. - name: Upload Release
  104. if: startsWith(matrix.target, 'x86_64')
  105. uses: softprops/action-gh-release@v1
  106. with:
  107. tag_name: alpha
  108. name: "Clash Verge Rev Alpha"
  109. body: "More new features are now supported."
  110. prerelease: true
  111. token: ${{ secrets.GITHUB_TOKEN }}
  112. files: src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage*
  113. - name: Upload Release
  114. uses: softprops/action-gh-release@v1
  115. with:
  116. tag_name: alpha
  117. name: "Clash Verge Rev Alpha"
  118. body: "More new features are now supported."
  119. prerelease: true
  120. token: ${{ secrets.GITHUB_TOKEN }}
  121. files: src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb