ci.yml 2.5 KB

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