From e9f0443b966c1bd783a25c7b3ac815a6cdda0f9a Mon Sep 17 00:00:00 2001 From: harakeishi Date: Thu, 24 Feb 2022 23:08:02 +0900 Subject: [PATCH 1/4] test --- .github/workflows/release.yml | 2 -- .goreleaser.yaml | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1d3e350..eb8596e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,8 +2,6 @@ name: goreleaser on: push: - branches: - - main jobs: goreleaser: diff --git a/.goreleaser.yaml b/.goreleaser.yaml index c33aec6..74f6011 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -14,7 +14,8 @@ builds: ldflags: - -s -w -X "main.version={{.Env.Version}}" archives: - - replacements: + - format: binary + replacements: darwin: Darwin linux: Linux windows: Windows From 14c42ee9423725b819c66d955424902899220faa Mon Sep 17 00:00:00 2001 From: harakeishi Date: Thu, 24 Feb 2022 23:29:41 +0900 Subject: [PATCH 2/4] Revert "test" This reverts commit e9f0443b966c1bd783a25c7b3ac815a6cdda0f9a. --- .github/workflows/release.yml | 2 ++ .goreleaser.yaml | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eb8596e..1d3e350 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,6 +2,8 @@ name: goreleaser on: push: + branches: + - main jobs: goreleaser: diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 74f6011..c33aec6 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -14,8 +14,7 @@ builds: ldflags: - -s -w -X "main.version={{.Env.Version}}" archives: - - format: binary - replacements: + - replacements: darwin: Darwin linux: Linux windows: Windows From 350470202a5845a586b39d9feeb329b997640acb Mon Sep 17 00:00:00 2001 From: harakeishi Date: Thu, 24 Feb 2022 23:29:58 +0900 Subject: [PATCH 3/4] test --- .github/workflows/release.yml | 2 -- cmd/root.go | 13 ++++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1d3e350..eb8596e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,8 +2,6 @@ name: goreleaser on: push: - branches: - - main jobs: goreleaser: diff --git a/cmd/root.go b/cmd/root.go index a5d7002..02b1566 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -3,6 +3,7 @@ package cmd import ( "fmt" "os" + "runtime/debug" whris "github.com/harakeishi/whris/whris" "github.com/spf13/cobra" @@ -20,7 +21,17 @@ var rootCmd = &cobra.Command{ os.Exit(1) } if version { - fmt.Println(Version) + if Version != "dev" { + fmt.Println(Version) + + return nil + } + if buildInfo, ok := debug.ReadBuildInfo(); ok { + fmt.Println(buildInfo.Main.Version) + + return nil + } + fmt.Println("unknown") return nil } domain := args[0] From c60e9483223d92357baa4b6201e815e6a6151315 Mon Sep 17 00:00:00 2001 From: harakeishi Date: Thu, 24 Feb 2022 23:34:40 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=E3=83=88=E3=83=AA=E3=82=AC=E3=83=BC?= =?UTF-8?q?=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eb8596e..1d3e350 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,6 +2,8 @@ name: goreleaser on: push: + branches: + - main jobs: goreleaser: