ci.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. name: CI
  2. on: [push]
  3. env:
  4. CARGO_INCREMENTAL: 0
  5. RUST_BACKTRACE: short
  6. jobs:
  7. # only cargo test now
  8. test:
  9. strategy:
  10. matrix:
  11. os: [windows-latest, macos-11]
  12. runs-on: ${{ matrix.os }}
  13. steps:
  14. - name: Checkout repository
  15. uses: actions/checkout@v2
  16. - name: Install Rust
  17. uses: actions-rs/toolchain@v1
  18. with:
  19. toolchain: stable
  20. profile: minimal
  21. override: true
  22. - name: Rust Cache
  23. uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
  24. - name: Cargo Test
  25. run: |
  26. cargo check
  27. cargo test
  28. working-directory: ./src-tauri
  29. release:
  30. strategy:
  31. matrix:
  32. os: [windows-latest, macos-11]
  33. runs-on: ${{ matrix.os }}
  34. if: |
  35. startsWith(github.repository, 'zzzgydi') &&
  36. startsWith(github.ref, 'refs/tags/v')
  37. steps:
  38. - name: Checkout repository
  39. uses: actions/checkout@v2
  40. - name: Install Rust
  41. uses: actions-rs/toolchain@v1
  42. with:
  43. toolchain: stable
  44. profile: minimal
  45. override: true
  46. - name: Rust Cache
  47. uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
  48. - name: Cargo Test
  49. run: |
  50. cargo check
  51. cargo test
  52. working-directory: ./src-tauri
  53. - name: Install Node
  54. uses: actions/setup-node@v1
  55. with:
  56. node-version: 14
  57. - name: Get yarn cache dir path
  58. id: yarn-cache-dir-path
  59. run: echo "::set-output name=dir::$(yarn cache dir)"
  60. - name: Yarn Cache
  61. uses: actions/cache@v2
  62. id: yarn-cache
  63. with:
  64. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  65. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  66. restore-keys: |
  67. ${{ runner.os }}-yarn-
  68. - name: Yarn install and check
  69. run: yarn && yarn run check
  70. - name: Tauri build
  71. uses: tauri-apps/tauri-action@v0
  72. env:
  73. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  74. with:
  75. tagName: v__VERSION__
  76. releaseName: "Clash Verge v__VERSION__"
  77. releaseBody: "Clash Verge now supports Windows and macos(intel)."
  78. releaseDraft: false
  79. prerelease: true