-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from eolinker/feature/add-version
新增apinto-dashboard版本显示
- Loading branch information
Showing
5 changed files
with
45 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,9 @@ jobs: | |
- name: Checkout #Checkout代码 | ||
uses: actions/checkout@v3 | ||
- name: GoTidy | ||
run: go mod tidy -compat=1.17 | ||
run: | | ||
go mod tidy -compat=1.17 | ||
echo "GOVERSION=$(go version)" >> $GITHUB_ENV | ||
- name: Create archives on Release #创建各种系统架构下的二进制包并上传至release assets | ||
uses: goreleaser/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ | |
/out/ | ||
/builds/sqlite.db | ||
*.DS_Store | ||
/dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package version | ||
|
||
import ( | ||
"bytes" | ||
"fmt" | ||
) | ||
|
||
// These should be set via go build -ldflags -X 'xxxx'. | ||
var Version = "unknown" | ||
var goVersion = "unknown" | ||
var gitCommit = "unknown" | ||
var buildTime = "unknown" | ||
var buildUser = "unknown" | ||
|
||
var profileInfo []byte | ||
|
||
func init() { | ||
buffer := &bytes.Buffer{} | ||
fmt.Fprintf(buffer, "Apinto version: %s\n", Version) | ||
fmt.Fprintf(buffer, "Golang version: %s\n", goVersion) | ||
fmt.Fprintf(buffer, "Git commit hash: %s\n", gitCommit) | ||
fmt.Fprintf(buffer, "Built on: %s\n", buildTime) | ||
fmt.Fprintf(buffer, "Built by: %s\n", buildUser) | ||
profileInfo = buffer.Bytes() | ||
} | ||
|
||
func Println() { | ||
fmt.Print(string(profileInfo)) | ||
} |