简单修改
This commit is contained in:
parent
5bfc197966
commit
790cab163d
|
@ -14,14 +14,25 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Setup Go environment
|
- name: Setup Go environment
|
||||||
uses: actions/setup-go@v2.1.3
|
uses: actions/setup-go@v2.1.3
|
||||||
with:
|
with:
|
||||||
go-version: 1.17
|
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
|
- name: Build binary file
|
||||||
run: |
|
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 mod tidy
|
||||||
go build -o "output/study_xxqg" -trimpath -ldflags "$LD_FLAGS" ./
|
go build -o "output/study_xxqg" -trimpath -ldflags "$LD_FLAGS" ./
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
}()
|
||||||
|
|
||||||
|
}
|
|
@ -45,7 +45,7 @@ func RouterInit() *gin.Engine {
|
||||||
log.Errorln(err.Error())
|
log.Errorln(err.Error())
|
||||||
f, _ = newUI.ReadFile("app/home.html")
|
f, _ = newUI.ReadFile("app/home.html")
|
||||||
}
|
}
|
||||||
ctx.Writer.Write(f)
|
_, _ = ctx.Writer.Write(f)
|
||||||
ctx.Status(200)
|
ctx.Status(200)
|
||||||
})
|
})
|
||||||
// 对权限的管理组
|
// 对权限的管理组
|
||||||
|
|
Loading…
Reference in New Issue