ci.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. with:
  27. working-directory: src-tauri
  28. - name: Install Node
  29. uses: actions/setup-node@v1
  30. with:
  31. node-version: 14
  32. - name: Install Dependencies (ubuntu only)
  33. if: matrix.os == 'ubuntu-latest'
  34. run: |
  35. sudo apt-get update
  36. sudo apt-get install -y libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libappindicator3-dev librsvg2-dev libayatana-appindicator3-dev
  37. - name: Get yarn cache dir path
  38. id: yarn-cache-dir-path
  39. run: echo "::set-output name=dir::$(yarn cache dir)"
  40. - name: Yarn Cache
  41. uses: actions/cache@v2
  42. id: yarn-cache
  43. with:
  44. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  45. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  46. restore-keys: |
  47. ${{ runner.os }}-yarn-
  48. - name: Yarn install and check
  49. run: |
  50. yarn install --network-timeout 1000000
  51. yarn run check
  52. - name: Tauri build
  53. uses: tauri-apps/tauri-action@0e558392ccadcb49bcc89e7df15a400e8f0c954d
  54. # enable cache even though failed
  55. # continue-on-error: true
  56. env:
  57. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  58. TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
  59. TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
  60. with:
  61. tagName: v__VERSION__
  62. releaseName: "Clash Verge v__VERSION__"
  63. releaseBody: "More new features are now supported."
  64. releaseDraft: false
  65. prerelease: true
  66. - name: Portable Bundle
  67. if: matrix.os == 'windows-latest'
  68. # rebuild with env settings
  69. run: |
  70. yarn build
  71. yarn run portable
  72. env:
  73. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  74. TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
  75. TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
  76. VITE_WIN_PORTABLE: 1
  77. release-update:
  78. needs: release
  79. runs-on: macos-latest
  80. if: |
  81. startsWith(github.repository, 'zzzgydi') &&
  82. startsWith(github.ref, 'refs/tags/v')
  83. steps:
  84. - name: Checkout repository
  85. uses: actions/checkout@v2
  86. - name: Get yarn cache dir path
  87. id: yarn-cache-dir-path
  88. run: echo "::set-output name=dir::$(yarn cache dir)"
  89. - name: Yarn Cache
  90. uses: actions/cache@v2
  91. id: yarn-cache
  92. with:
  93. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  94. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  95. restore-keys: |
  96. ${{ runner.os }}-yarn-
  97. - name: Yarn install
  98. run: yarn install
  99. - name: Release updater file
  100. run: yarn run updater
  101. env:
  102. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}