mirror of https://github.com/bjdgyc/anylink.git
Create go-update.yml
This commit is contained in:
parent
2e86547e97
commit
e73504b4b6
|
@ -0,0 +1,44 @@
|
|||
name: go-update
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "0 0 * * */7"
|
||||
jobs:
|
||||
go:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Go 1.x.y
|
||||
uses: actions/setup-go@main
|
||||
with:
|
||||
go-version: ^1.21
|
||||
- name: Checkout codebase
|
||||
uses: actions/checkout@main
|
||||
|
||||
- name: go
|
||||
run: |
|
||||
cd ./server
|
||||
go mod tidy -compat=1.21
|
||||
gofmt -w -r 'interface{} -> any' .
|
||||
go get -u
|
||||
go mod download
|
||||
go get -u
|
||||
go mod download
|
||||
|
||||
- name: Git push
|
||||
run: |
|
||||
git init
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git remote rm origin
|
||||
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUBTOKEN }}@github.com/${{ github.repository }}"
|
||||
git gc --aggressive
|
||||
git add --all
|
||||
git commit -m "update go.mod $(date +%Y.%m.%d.%H.%M)"
|
||||
git push -f -u origin dev
|
||||
|
||||
# 删除无用 workflow runs;
|
||||
- name: Delete workflow runs
|
||||
uses: GitRML/delete-workflow-runs@main
|
||||
with:
|
||||
retain_days: 0.1
|
||||
keep_minimum_runs: 1
|
Loading…
Reference in New Issue