ci.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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: Install Node
  27. uses: actions/setup-node@v1
  28. with:
  29. node-version: 14
  30. - name: Get yarn cache dir path
  31. id: yarn-cache-dir-path
  32. run: echo "::set-output name=dir::$(yarn cache dir)"
  33. - name: Yarn Cache
  34. uses: actions/cache@v2
  35. id: yarn-cache
  36. with:
  37. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  38. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  39. restore-keys: |
  40. ${{ runner.os }}-yarn-
  41. - name: Yarn install and check
  42. run: yarn && yarn run check
  43. - name: Tauri build
  44. uses: tauri-apps/tauri-action@v0
  45. # enable cache even though failed
  46. continue-on-error: true
  47. env:
  48. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  49. with:
  50. tagName: v__VERSION__
  51. releaseName: "Clash Verge v__VERSION__"
  52. releaseBody: "Clash Verge now supports Windows and macos(intel)."
  53. releaseDraft: false
  54. prerelease: true
  55. release-update:
  56. needs: release
  57. runs-on: macos-11
  58. if: |
  59. startsWith(github.repository, 'zzzgydi') &&
  60. startsWith(github.ref, 'refs/tags/v')
  61. steps:
  62. - name: Checkout repository
  63. uses: actions/checkout@v2
  64. - name: Get yarn cache dir path
  65. id: yarn-cache-dir-path
  66. run: echo "::set-output name=dir::$(yarn cache dir)"
  67. - name: Yarn Cache
  68. uses: actions/cache@v2
  69. id: yarn-cache
  70. with:
  71. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  72. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  73. restore-keys: |
  74. ${{ runner.os }}-yarn-
  75. - name: Yarn install
  76. run: yarn
  77. - name: Release update.json
  78. run: yarn run release
  79. continue-on-error: true
  80. env:
  81. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}