Skip to content

Commit a430f75

Browse files
committed
Polish update-go-dependencies.yml
1 parent f93d712 commit a430f75

File tree

1 file changed

+6
-31
lines changed

1 file changed

+6
-31
lines changed
Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,40 @@
11
name: Update Clash-Core and Go Modules
2+
23
on:
34
repository_dispatch:
45
types:
56
- core-updated
67
workflow_dispatch:
78

89
jobs:
9-
update-dependencies:
10+
update-go-dependencies:
1011
runs-on: ubuntu-latest
1112
steps:
12-
- name: Checkout Repository
13-
uses: actions/checkout@v4
14-
15-
- name: Checkout and Update submodules
16-
run: git submodule update --init --recursive --remote --force
17-
18-
- name: Setup Java
19-
uses: actions/setup-java@v4
20-
with:
21-
distribution: "temurin"
22-
java-version: 21
23-
24-
- name: Setup Go
25-
uses: actions/setup-go@v6
13+
- uses: actions/checkout@v4
14+
- name: Checkout submodules # This is required, don't use submodules flag for actions/checkout instead.
15+
run: git submodule update --init --recursive --force
16+
- uses: actions/setup-go@v6
2617
with:
2718
go-version: "1.26"
2819
check-latest: true # Always check for the latest patch release
29-
30-
- uses: actions/cache@v4
31-
with:
32-
path: |
33-
~/.cache/go-build
34-
~/go/pkg/mod
35-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
36-
restore-keys: |
37-
${{ runner.os }}-go-
38-
3920
- name: Install update-go-mod-replace
4021
run: |
4122
go install github.com/metacubex/update-go-mod-replace@latest
42-
4323
- name: Update Foss Gomod
4424
run: |
4525
cd ${{ github.workspace }}/core/src/foss/golang/
4626
update-go-mod-replace ${{ github.workspace }}/core/src/foss/golang/clash/go.mod $(pwd)/go.mod
4727
go mod tidy
48-
4928
- name: Update Main Gomod
5029
run: |
5130
cd ${{ github.workspace }}/core/src/main/golang/
5231
update-go-mod-replace ${{ github.workspace }}/core/src/foss/golang/clash/go.mod $(pwd)/go.mod
5332
go mod tidy
54-
5533
- uses: tibdex/github-app-token@v2
5634
id: generate-token
5735
with:
5836
app_id: ${{ secrets.MAINTAINER_APPID }}
5937
private_key: ${{ secrets.MAINTAINER_APP_PRIVATE_KEY }}
60-
6138
- name: Create Pull Request
6239
id: cpr
6340
uses: peter-evans/create-pull-request@v6
@@ -73,10 +50,8 @@ jobs:
7350
- Update Go Module Dependecies
7451
labels: |
7552
Update
76-
7753
- name: PR result
7854
if: ${{ steps.cpr.outputs.pull-request-number }}
7955
run: |
8056
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
8157
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
82-

0 commit comments

Comments
 (0)