Skip to content

Commit

Permalink
Add goreleaser
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Coffman <[email protected]>
  • Loading branch information
StevenACoffman committed Aug 22, 2021
1 parent 6f1223b commit 8cf635d
Show file tree
Hide file tree
Showing 17 changed files with 50 additions and 28 deletions.
35 changes: 26 additions & 9 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ builds:
- linux
- windows
- darwin
binary: jt
archives:
- replacements:
darwin: Darwin
Expand All @@ -30,15 +31,31 @@ changelog:
- '^test:'
brews:
-
name: jira-tool
github:
# Name template of the recipe
# Default to project name
name: jt

# GitHub/GitLab repository to push the formula to
# Gitea is not supported yet, but the support coming
tap:
owner: StevenACoffman
name: homebrew-jira-tool
name: homebrew-jt
# Optionally a token can be provided, if it differs from the token provided to GoReleaser
# token: "{{ .Env.GITHUB_AUTH_TOKEN }}"
folder: Formula
homepage: "https://github.com/StevenACoffman/jira-tool"
description: jt - jira-tool is a CLI tool for viewing and manipulating JIRA issues.
test: |
system "#{bin}/jt", "--version"
# Your app's homepage.
# Default is empty.
homepage: "https://github.com/StevenACoffman/jt"

# Template of your app's description.
# Default is empty.
description: jt is a CLI tool for viewing and manipulating JIRA issues.

# SPDX identifier of your app's license.
# Default is empty.
license: "MIT"

# Custom install script for brew.
# Default is 'bin.install "program"'.
install: |
bin.install "jt" => "jt"
prefix.install_metafiles
bin.install "jt"
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ Shared Flags:
### tips
Use "jt [command] --help" for more information about a command.

### installation
```
brew
```

2 changes: 1 addition & 1 deletion cmd/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"fmt"
"github.com/StevenACoffman/jira-tool/pkg/atlassian"
"github.com/StevenACoffman/jt/pkg/atlassian"
"os"

"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion cmd/done.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package cmd

import (
"fmt"
"github.com/StevenACoffman/jira-tool/pkg/atlassian"
"github.com/StevenACoffman/jt/pkg/atlassian"
"os"

"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion cmd/land.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"fmt"
"github.com/StevenACoffman/jira-tool/pkg/atlassian"
"github.com/StevenACoffman/jt/pkg/atlassian"
"os"

"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion cmd/onit.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"fmt"
"github.com/StevenACoffman/jira-tool/pkg/atlassian"
"github.com/StevenACoffman/jt/pkg/atlassian"
"os"

"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion cmd/review.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"fmt"
"github.com/StevenACoffman/jira-tool/pkg/atlassian"
"github.com/StevenACoffman/jt/pkg/atlassian"
"os"

"github.com/spf13/cobra"
Expand Down
4 changes: 2 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"fmt"
"github.com/StevenACoffman/jira-tool/pkg/atlassian"
"github.com/StevenACoffman/jt/pkg/atlassian"
"github.com/spf13/cobra"
"os"

Expand Down Expand Up @@ -75,7 +75,7 @@ func initConfig() {
os.Exit(1)
}

// Search config in home directory with name ".jira-tool" (without extension).
// Search config in home directory with name ".jt" (without extension).
v.AddConfigPath(home+"/.config")
v.SetConfigName("jira")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/take.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"fmt"
"github.com/StevenACoffman/jira-tool/pkg/atlassian"
"github.com/StevenACoffman/jt/pkg/atlassian"
"os"

"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion cmd/todo.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"fmt"
"github.com/StevenACoffman/jira-tool/pkg/atlassian"
"github.com/StevenACoffman/jt/pkg/atlassian"
"os"

"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion cmd/triage.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"fmt"
"github.com/StevenACoffman/jira-tool/pkg/atlassian"
"github.com/StevenACoffman/jt/pkg/atlassian"
"os"

"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion cmd/wti.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"fmt"
"github.com/StevenACoffman/jira-tool/pkg/atlassian"
"github.com/StevenACoffman/jt/pkg/atlassian"

"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/StevenACoffman/jira-tool
module github.com/StevenACoffman/jt

go 1.15

Expand Down
4 changes: 2 additions & 2 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func Install() error {
// Clean up after yourself
func Clean() {
fmt.Println("Cleaning...")
os.RemoveAll("jt")
os.RemoveAll(appName)
}

var releaseTag = regexp.MustCompile(`^v[0-9]+\.[0-9]+\.[0-9]+$`)
Expand All @@ -66,7 +66,7 @@ func Release(tag string) (err error) {
sh.RunV("git", "push", "--delete", "origin", "$TAG")
}
}()
return sh.RunV("goreleaser")
return sh.RunV("goreleaser", "--rm-dist")
}


Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import "github.com/StevenACoffman/jira-tool/cmd"
import "github.com/StevenACoffman/jt/cmd"

func main() {
cmd.Execute()
Expand Down
6 changes: 3 additions & 3 deletions pkg/atlassian/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (

// Config struct
type Config struct {
Host string `json:"host",mapstructure:"host"`
User string `json:"user",mapstructure:"user"`
Token string `json:"token",mapstructure:"token"`
Host string `json:"host" mapstructure:"host"`
User string `json:"user" mapstructure:"user"`
Token string `json:"token" mapstructure:"token"`
}

// ReadConfigFromFile returns an error if file does not exist
Expand Down
2 changes: 1 addition & 1 deletion pkg/atlassian/jira.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strconv"
"strings"

"github.com/StevenACoffman/jira-tool/pkg/middleware"
"github.com/StevenACoffman/jt/pkg/middleware"

"github.com/andygrunwald/go-jira"
)
Expand Down

0 comments on commit 8cf635d

Please sign in to comment.