ci.yml 3.3 KB

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