ci.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. name: Release CI
  2. on:
  3. push:
  4. tags:
  5. - v**
  6. env:
  7. CARGO_INCREMENTAL: 0
  8. RUST_BACKTRACE: short
  9. jobs:
  10. release:
  11. strategy:
  12. matrix:
  13. os: [windows-latest, ubuntu-latest, macos-latest]
  14. runs-on: ${{ matrix.os }}
  15. if: |
  16. startsWith(github.repository, 'zzzgydi') &&
  17. startsWith(github.ref, 'refs/tags/v')
  18. steps:
  19. - name: Checkout repository
  20. uses: actions/checkout@v2
  21. - name: Install Rust
  22. uses: actions-rs/toolchain@v1
  23. with:
  24. toolchain: stable
  25. profile: minimal
  26. override: true
  27. - name: Rust Cache
  28. uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
  29. with:
  30. working-directory: src-tauri
  31. - name: Install Node
  32. uses: actions/setup-node@v1
  33. with:
  34. node-version: 14
  35. - name: Install Dependencies (ubuntu only)
  36. if: startsWith(matrix.os, 'ubuntu-')
  37. run: |
  38. sudo apt-get update
  39. 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
  40. - name: Get yarn cache dir path
  41. id: yarn-cache-dir-path
  42. run: echo "::set-output name=dir::$(yarn cache dir)"
  43. - name: Yarn Cache
  44. uses: actions/cache@v2
  45. id: yarn-cache
  46. with:
  47. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  48. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  49. restore-keys: |
  50. ${{ runner.os }}-yarn-
  51. - name: Yarn install and check
  52. run: |
  53. yarn install --network-timeout 1000000
  54. yarn run check
  55. - name: Tauri build
  56. uses: tauri-apps/tauri-action@0e558392ccadcb49bcc89e7df15a400e8f0c954d
  57. # enable cache even though failed
  58. # continue-on-error: true
  59. env:
  60. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  61. TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
  62. TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
  63. with:
  64. tagName: v__VERSION__
  65. releaseName: "Clash Verge v__VERSION__"
  66. releaseBody: "More new features are now supported."
  67. releaseDraft: false
  68. prerelease: true
  69. - name: Portable Bundle
  70. if: matrix.os == 'windows-latest'
  71. # rebuild with env settings
  72. run: |
  73. yarn build
  74. yarn run portable
  75. env:
  76. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  77. TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
  78. TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
  79. VITE_WIN_PORTABLE: 1
  80. release-update:
  81. needs: release
  82. runs-on: macos-latest
  83. if: |
  84. startsWith(github.repository, 'zzzgydi') &&
  85. startsWith(github.ref, 'refs/tags/v')
  86. steps:
  87. - name: Checkout repository
  88. uses: actions/checkout@v2
  89. - name: Get yarn cache dir path
  90. id: yarn-cache-dir-path
  91. run: echo "::set-output name=dir::$(yarn cache dir)"
  92. - name: Yarn Cache
  93. uses: actions/cache@v2
  94. id: yarn-cache
  95. with:
  96. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  97. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  98. restore-keys: |
  99. ${{ runner.os }}-yarn-
  100. - name: Yarn install
  101. run: yarn install
  102. - name: Release updater file
  103. run: yarn run updater
  104. env:
  105. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}