2023-10-22 10:57:35 +03:00
|
|
|
name: Update Clash-Core and Go Modules
|
|
|
|
on:
|
|
|
|
repository_dispatch:
|
|
|
|
types:
|
|
|
|
- core-updated
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
update-dependencies:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout Repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Checkout submodules
|
|
|
|
run: git submodule update --init --recursive --remote --force
|
|
|
|
|
|
|
|
- name: Setup Java
|
|
|
|
uses: actions/setup-java@v3
|
|
|
|
with:
|
|
|
|
distribution: 'zulu'
|
|
|
|
java-version: 17
|
|
|
|
|
|
|
|
- name: Setup Go
|
|
|
|
uses: actions/setup-go@v3
|
|
|
|
with:
|
|
|
|
go-version: "1.20"
|
|
|
|
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cache/go-build
|
|
|
|
~/go/pkg/mod
|
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-go-
|
|
|
|
|
|
|
|
- name: Download GeoIP Database
|
|
|
|
run: |
|
|
|
|
./gradlew :core:downloadGeoipDatabase
|
|
|
|
|
|
|
|
- name: Update Foss Gomod
|
|
|
|
run: |
|
|
|
|
cd ${{ github.workspace }}/core/src/foss/golang/
|
2023-10-22 16:06:05 +03:00
|
|
|
go mod tidy
|
2023-10-22 10:57:35 +03:00
|
|
|
|
|
|
|
- name: Update Main Gomod
|
|
|
|
run: |
|
|
|
|
cd ${{ github.workspace }}/core/src/main/golang/native/
|
2023-10-22 16:06:05 +03:00
|
|
|
go mod tidy
|
2023-10-22 10:57:35 +03:00
|
|
|
|
2023-10-22 16:48:35 +03:00
|
|
|
- uses: tibdex/github-app-token@v1
|
|
|
|
id: generate-token
|
|
|
|
with:
|
|
|
|
app_id: ${{ secrets.MAINTAINER_APPID }}
|
|
|
|
private_key: ${{ secrets.MAINTAINER_APP_PRIVATE_KEY }}
|
|
|
|
|
2023-10-22 10:57:35 +03:00
|
|
|
- name: Create Pull Request
|
|
|
|
id: cpr
|
|
|
|
uses: peter-evans/create-pull-request@v5
|
|
|
|
with:
|
2023-10-22 16:48:35 +03:00
|
|
|
token: ${{ steps.generate-token.outputs.token }}
|
2023-10-22 10:57:35 +03:00
|
|
|
commit-message: Update Dependencies
|
|
|
|
branch: update-dependencies
|
|
|
|
delete-branch: true
|
|
|
|
title: 'Update Dependencies'
|
|
|
|
draft: false
|
|
|
|
body: |
|
|
|
|
- Update Clash-Meta Core
|
|
|
|
- Update Go Module Dependecies
|
|
|
|
labels: |
|
|
|
|
Update
|
|
|
|
|
|
|
|
- name: PR result
|
|
|
|
if: ${{ steps.cpr.outputs.pull-request-number }}
|
|
|
|
run: |
|
|
|
|
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
|
|
|
|
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
|
|
|
|
|