简单修改

This commit is contained in:
johlanse 2022-08-05 17:25:12 +08:00
parent 5bfc197966
commit 790cab163d
3 changed files with 31 additions and 2 deletions

View File

@ -14,14 +14,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Go environment
uses: actions/setup-go@v2.1.3
with:
go-version: 1.17
- name: set default tag
run: |
echo "RELEASE_VERSION=dev" >> $GITHUB_ENV
- name: set tag
if: startsWith(github.ref, 'refs/tags/')
run: |
echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
- name: Build binary file
run: |
export LD_FLAGS="-w -s -X main.VERSION=${COMMIT_ID::7}"
echo ${env.RELEASE_VERSION}
export LD_FLAGS="-w -s -X main.VERSION=${env.RELEASE_VERSION}"
go mod tidy
go build -o "output/study_xxqg" -trimpath -ldflags "$LD_FLAGS" ./

18
utils/util.go Normal file
View File

@ -0,0 +1,18 @@
package utils
import (
"os"
"os/exec"
)
// Restart
/* @Description:
*/
func Restart() {
cmd := exec.Command("./study_xxqg")
go func() {
cmd.Start()
os.Exit(3)
}()
}

View File

@ -45,7 +45,7 @@ func RouterInit() *gin.Engine {
log.Errorln(err.Error())
f, _ = newUI.ReadFile("app/home.html")
}
ctx.Writer.Write(f)
_, _ = ctx.Writer.Write(f)
ctx.Status(200)
})
// 对权限的管理组