ci.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. name: Release 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, ubuntu-latest, macos-latest]
  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: Install Dependencies (ubuntu only)
  31. if: matrix.os == 'ubuntu-latest'
  32. run: |
  33. sudo apt-get update
  34. sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
  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: |
  48. yarn install --network-timeout 1000000
  49. yarn run check
  50. - name: Tauri build
  51. uses: tauri-apps/tauri-action@0e558392ccadcb49bcc89e7df15a400e8f0c954d
  52. # enable cache even though failed
  53. # continue-on-error: true
  54. env:
  55. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  56. TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
  57. TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
  58. with:
  59. tagName: v__VERSION__
  60. releaseName: "Clash Verge v__VERSION__"
  61. releaseBody: "More new features are now supported."
  62. releaseDraft: false
  63. prerelease: true
  64. - name: Green zip bundle
  65. if: matrix.os == 'windows-latest'
  66. run: |
  67. yarn run portable
  68. env:
  69. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  70. release-update:
  71. needs: release
  72. runs-on: macos-latest
  73. if: |
  74. startsWith(github.repository, 'zzzgydi') &&
  75. startsWith(github.ref, 'refs/tags/v')
  76. steps:
  77. - name: Checkout repository
  78. uses: actions/checkout@v2
  79. - name: Get yarn cache dir path
  80. id: yarn-cache-dir-path
  81. run: echo "::set-output name=dir::$(yarn cache dir)"
  82. - name: Yarn Cache
  83. uses: actions/cache@v2
  84. id: yarn-cache
  85. with:
  86. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  87. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  88. restore-keys: |
  89. ${{ runner.os }}-yarn-
  90. - name: Yarn install
  91. run: yarn install
  92. - name: Release updater file
  93. run: yarn run updater
  94. env:
  95. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}