ci.yml 2.2 KB

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