mirror of https://github.com/bjdgyc/anylink.git
49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
name: go-update
|
|
on:
|
|
workflow_dispatch:
|
|
# schedule:
|
|
# - cron: "1 2 * * 5"
|
|
|
|
jobs:
|
|
go:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Setup Go 1.x.y
|
|
uses: actions/setup-go@main
|
|
with:
|
|
go-version: '1.20'
|
|
stable: true
|
|
|
|
- name: Checkout codebase
|
|
uses: actions/checkout@main
|
|
|
|
- name: go
|
|
run: |
|
|
cd ./server
|
|
go mod tidy -compat=1.20
|
|
#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 _autoaction
|
|
git push -u origin _autoaction
|
|
|
|
# 删除无用 workflow runs;
|
|
- name: Delete workflow runs
|
|
uses: GitRML/delete-workflow-runs@main
|
|
with:
|
|
retain_days: 0.1
|
|
keep_minimum_runs: 1
|