Skip to content

Commit

Permalink
add versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
dkotik committed Feb 22, 2022
1 parent e042c61 commit bbd5302
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
6 changes: 4 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion cmd/mdsend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 6 additions & 0 deletions mdsend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions userinterface/bubbletea/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"fmt"
"mdsend"
"mdsend/userinterface/bubbletea/echobox"
"mdsend/userinterface/bubbletea/recipientlist"
"mdsend/userinterface/bubbletea/scroll"
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit bbd5302

Please sign in to comment.