mirror of
https://gitee.com/WuKongDev/WuKongIM.git
synced 2025-12-06 14:59:08 +08:00
fix: update
This commit is contained in:
14
main.go
14
main.go
@@ -1,16 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/WuKongIM/WuKongIM/cmd"
|
||||
"github.com/WuKongIM/WuKongIM/version"
|
||||
)
|
||||
|
||||
var Version string
|
||||
// go ldflags
|
||||
var Version string // version
|
||||
var Commit string // git commit id
|
||||
var CommitDate string // git commit date
|
||||
var TreeState string // git tree state
|
||||
|
||||
func main() {
|
||||
|
||||
fmt.Println("WuKongIM version:", Version)
|
||||
version.Version = Version
|
||||
version.Commit = Commit
|
||||
version.CommitDate = CommitDate
|
||||
version.TreeState = TreeState
|
||||
|
||||
// logFile, err := os.OpenFile("./fatal.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0660)
|
||||
// if err != nil {
|
||||
|
||||
@@ -30,7 +30,7 @@ binary: wukongim-{{ .Os }}-{{ .Arch }}
|
||||
|
||||
# (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow.
|
||||
ldflags:
|
||||
- "-X github.com/$GITHUB_REPOSITORY/version.Version={{ .Env.VERSION }}"
|
||||
- "-X github.com/$GITHUB_REPOSITORY/version.Commit={{ .Env.COMMIT }}"
|
||||
- "-X github.com/$GITHUB_REPOSITORY/version.CommitDate={{ .Env.COMMIT_DATE }}"
|
||||
- "-X github.com/$GITHUB_REPOSITORY/version.TreeState={{ .Env.TREE_STATE }}"
|
||||
- "-X main.Version={{ .Env.VERSION }}"
|
||||
- "-X main.Commit={{ .Env.COMMIT }}"
|
||||
- "-X main.CommitDate={{ .Env.COMMIT_DATE }}"
|
||||
- "-X main.TreeState={{ .Env.TREE_STATE }}"
|
||||
@@ -30,7 +30,7 @@ binary: wukongim-{{ .Os }}-{{ .Arch }}
|
||||
|
||||
# (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow.
|
||||
ldflags:
|
||||
- "-X github.com/$GITHUB_REPOSITORY/version.Version={{ .Env.VERSION }}"
|
||||
- "-X github.com/$GITHUB_REPOSITORY/version.Commit={{ .Env.COMMIT }}"
|
||||
- "-X github.com/$GITHUB_REPOSITORY/version.CommitDate={{ .Env.COMMIT_DATE }}"
|
||||
- "-X github.com/$GITHUB_REPOSITORY/version.TreeState={{ .Env.TREE_STATE }}"
|
||||
- "-X main.Version={{ .Env.VERSION }}"
|
||||
- "-X main.Commit={{ .Env.COMMIT }}"
|
||||
- "-X main.CommitDate={{ .Env.COMMIT_DATE }}"
|
||||
- "-X main.TreeState={{ .Env.TREE_STATE }}"
|
||||
@@ -30,7 +30,7 @@ binary: wukongim-{{ .Os }}-{{ .Arch }}
|
||||
|
||||
# (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow.
|
||||
ldflags:
|
||||
- "-X github.com/$GITHUB_REPOSITORY/version.Version={{ .Env.VERSION }}"
|
||||
- "-X github.com/$GITHUB_REPOSITORY/version.Commit={{ .Env.COMMIT }}"
|
||||
- "-X github.com/$GITHUB_REPOSITORY/version.CommitDate={{ .Env.COMMIT_DATE }}"
|
||||
- "-X github.com/$GITHUB_REPOSITORY/version.TreeState={{ .Env.TREE_STATE }}"
|
||||
- "-X main.Version={{ .Env.VERSION }}"
|
||||
- "-X main.Commit={{ .Env.COMMIT }}"
|
||||
- "-X main.CommitDate={{ .Env.COMMIT_DATE }}"
|
||||
- "-X main.TreeState={{ .Env.TREE_STATE }}"
|
||||
@@ -30,7 +30,7 @@ binary: wukongim-{{ .Os }}-{{ .Arch }}
|
||||
|
||||
# (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow.
|
||||
ldflags:
|
||||
- "-X github.com/$GITHUB_REPOSITORY/version.Version={{ .Env.VERSION }}"
|
||||
- "-X github.com/$GITHUB_REPOSITORY/version.Commit={{ .Env.COMMIT }}"
|
||||
- "-X github.com/$GITHUB_REPOSITORY/version.CommitDate={{ .Env.COMMIT_DATE }}"
|
||||
- "-X github.com/$GITHUB_REPOSITORY/version.TreeState={{ .Env.TREE_STATE }}"
|
||||
- "-X main.Version={{ .Env.VERSION }}"
|
||||
- "-X main.Commit={{ .Env.COMMIT }}"
|
||||
- "-X main.CommitDate={{ .Env.COMMIT_DATE }}"
|
||||
- "-X main.TreeState={{ .Env.TREE_STATE }}"
|
||||
@@ -1,6 +1,5 @@
|
||||
package version
|
||||
|
||||
// go ldflags
|
||||
var Version string // version
|
||||
var Commit string // git commit id
|
||||
var CommitDate string // git commit date
|
||||
|
||||
Reference in New Issue
Block a user