update-dependencies.yaml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. name: Update Clash-Core and Go Modules
  2. on:
  3. repository_dispatch:
  4. types:
  5. - core-updated
  6. workflow_dispatch:
  7. env:
  8. # go dependencies that should be fixed to certain version
  9. PACKAGES_DO_NOT_UPGRADE: >-
  10. github.com/Dreamacro/clash@v1.7.1
  11. github.com/Kr328/tun2socket@v0.0.0-20220414050025-d07c78d06d34
  12. jobs:
  13. update-dependencies:
  14. runs-on: ubuntu-latest
  15. steps:
  16. - name: Checkout Repository
  17. uses: actions/checkout@v3
  18. - name: Checkout submodules
  19. run: git submodule update --init --recursive --remote --force
  20. - name: Setup Java
  21. uses: actions/setup-java@v3
  22. with:
  23. distribution: 'zulu'
  24. java-version: 17
  25. - name: Setup Go
  26. uses: actions/setup-go@v3
  27. with:
  28. go-version: "1.20"
  29. - uses: actions/cache@v3
  30. with:
  31. path: |
  32. ~/.cache/go-build
  33. ~/go/pkg/mod
  34. key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
  35. restore-keys: |
  36. ${{ runner.os }}-go-
  37. - name: Download GeoIP Database
  38. run: |
  39. ./gradlew :core:downloadGeoipDatabase
  40. - name: Update Foss Gomod
  41. run: |
  42. cd ${{ github.workspace }}/core/src/foss/golang/
  43. go get -u ${{ env.PACKAGES_DO_NOT_UPGRADE }}
  44. - name: Update Main Gomod
  45. run: |
  46. cd ${{ github.workspace }}/core/src/main/golang/native/
  47. go get -u -d ${{ env.PACKAGES_DO_NOT_UPGRADE }}
  48. - name: Create Pull Request
  49. id: cpr
  50. uses: peter-evans/create-pull-request@v5
  51. with:
  52. commit-message: Update Dependencies
  53. branch: update-dependencies
  54. delete-branch: true
  55. title: 'Update Dependencies'
  56. draft: false
  57. body: |
  58. - Update Clash-Meta Core
  59. - Update Go Module Dependecies
  60. labels: |
  61. Update
  62. - name: PR result
  63. if: ${{ steps.cpr.outputs.pull-request-number }}
  64. run: |
  65. echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
  66. echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"