ci.yml 1.7 KB

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