diff --git a/.github/workflows/goreleaser.yaml b/.github/workflows/goreleaser.yaml index 2075c22..a4106d3 100644 --- a/.github/workflows/goreleaser.yaml +++ b/.github/workflows/goreleaser.yaml @@ -25,6 +25,6 @@ jobs: version: latest args: release --rm-dist env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GO_RELEASER_GITHUB_TOKEN }} # Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution # GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index e73c051..e6e2563 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,8 +1,7 @@ before: hooks: - # You may remove this if you don't use go modules. + - sed -i 's/const Version = "dev"/const Version = "{{ .Tag }}"/g' ./mdsend.go - go mod tidy - # you may remove this if you don't need go generate - go generate ./... builds: - dir: ./userinterface/bubbletea @@ -97,6 +96,9 @@ brews: # Packages your package depends on. dependencies: [] + install: | + bin.install "mdsend" + # So you can `brew test` your formula. # Default is empty. test: | diff --git a/cmd/mdsend/main.go b/cmd/mdsend/main.go index 8e263dc..aebb23c 100644 --- a/cmd/mdsend/main.go +++ b/cmd/mdsend/main.go @@ -25,7 +25,7 @@ func main() { CLI := &cobra.Command{ // Setup command line interface. Use: `mdsend`, - Version: `0.2.1 Alpha`, + Version: mdsend.Version + ` Alpha`, Short: `Sends markdown documents as templated emails.`, Long: `Sends markdown documents as templated emails.`, Run: func(cmd *cobra.Command, args []string) { diff --git a/mdsend.go b/mdsend.go index 73b5e89..f4ce186 100644 --- a/mdsend.go +++ b/mdsend.go @@ -2,9 +2,15 @@ package mdsend import ( "log" + "mdsend/distributors" "mdsend/loaders" + "mdsend/loggers" + "mdsend/providers" + "mdsend/renderers" ) +const Version = "dev" + // Options provide configuration to component execution. type Options struct { URI string // Credentials for provider API backend. diff --git a/userinterface/bubbletea/main.go b/userinterface/bubbletea/main.go index 6f4e174..62bd976 100644 --- a/userinterface/bubbletea/main.go +++ b/userinterface/bubbletea/main.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "mdsend" "mdsend/userinterface/bubbletea/echobox" "mdsend/userinterface/bubbletea/recipientlist" "mdsend/userinterface/bubbletea/scroll" @@ -60,6 +61,7 @@ func main() { }() if err := p.Start(); err != nil { + fmt.Printf("mdsend %s", mdsend.Version) fmt.Printf("Alas, there's been an error: %v", err) os.Exit(1) }