Skip to content

Commit

Permalink
feat: add version in release (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
nobe4 authored May 24, 2024
1 parent 647321e commit 630d04e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ builds:
- main: ./cmd/gh-not
env:
- CGO_ENABLED=0
ldflags:
- >
-s -w -X github.com/nobe4/gh-not/internal/cmd.version={{.Version}}
-X github.com/nobe4/gh-not/internal/cmd.commit={{.Commit}}
-X github.com/nobe4/gh-not/internal/cmd.date={{.Date}}
archives:
- name_template: "{{ .Os }}-{{ .Arch }}"
Expand All @@ -23,4 +28,4 @@ changelog:
use: github-native

release:
draft: true
draft: false
10 changes: 8 additions & 2 deletions internal/cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cmd

import (
"fmt"
"log/slog"
"os"
"path"
Expand All @@ -13,6 +14,10 @@ import (
)

var (
version = "dev"
commit = "123abc"
date = "now"

verbosityFlag int
configPathFlag string
refreshFlag bool
Expand All @@ -23,8 +28,9 @@ var (
client *gh.Client

rootCmd = &cobra.Command{
Use: "gh-not",
Short: "Manage your GitHub notifications",
Use: "gh-not",
Version: fmt.Sprintf("%s (%s) built at %s", version, commit, date),
Short: "Manage your GitHub notifications",
Example: `
gh-not --config list
gh-not --no-refresh list
Expand Down

0 comments on commit 630d04e

Please sign in to comment.