ci.yml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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@v3
  20. - name: install Rust stable
  21. uses: dtolnay/rust-toolchain@stable
  22. - name: Rust Cache
  23. uses: Swatinem/rust-cache@v2
  24. with:
  25. workspaces: src-tauri
  26. - name: Install Node
  27. uses: actions/setup-node@v3
  28. with:
  29. node-version: "16"
  30. cache: "yarn"
  31. - name: Install Dependencies (ubuntu only)
  32. if: startsWith(matrix.os, 'ubuntu-')
  33. run: |
  34. sudo apt-get update
  35. sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf openssl
  36. - name: Yarn install and check
  37. run: |
  38. yarn install --network-timeout 1000000 --frozen-lockfile
  39. yarn run check
  40. - name: Tauri build
  41. uses: tauri-apps/tauri-action@v0
  42. # enable cache even though failed
  43. # continue-on-error: true
  44. env:
  45. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  46. TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
  47. TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
  48. with:
  49. tagName: v__VERSION__
  50. releaseName: "Clash Verge v__VERSION__"
  51. releaseBody: "More new features are now supported."
  52. releaseDraft: false
  53. prerelease: true
  54. - name: Portable Bundle
  55. if: startsWith(matrix.os, 'windows-')
  56. # rebuild with env settings
  57. run: |
  58. yarn build
  59. yarn run portable
  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. VITE_WIN_PORTABLE: 1
  65. release-update:
  66. needs: release
  67. runs-on: ubuntu-latest
  68. if: |
  69. startsWith(github.repository, 'zzzgydi') &&
  70. startsWith(github.ref, 'refs/tags/v')
  71. steps:
  72. - name: Checkout repository
  73. uses: actions/checkout@v3
  74. - name: Install Node
  75. uses: actions/setup-node@v3
  76. with:
  77. node-version: "16"
  78. cache: "yarn"
  79. - name: Yarn install
  80. run: yarn install --network-timeout 1000000 --frozen-lockfile
  81. - name: Release updater file
  82. run: yarn run updater
  83. env:
  84. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}