ci.yml 3.3 KB

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