Skip to content

Commit

Permalink
feat: Added version flag
Browse files Browse the repository at this point in the history
  • Loading branch information
kerimkaan committed May 24, 2024
1 parent 23fb272 commit 1281a33
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 2 deletions.
33 changes: 32 additions & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,26 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: linux
goarch: amd64
cgo_enabled: 0
build_args: -ldflags "-s -w"
build_tags: linux-amd64

release-linux-arm64:
name: release linux/arm64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: linux
goarch: arm64
cgo_enabled: 0
build_args: -ldflags "-s -w"
build_tags: linux-arm64

release-mac-arm64:
name: release linux/amd64
name: release darwin/arm64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -29,5 +45,20 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: darwin
goarch: arm64
cgo_enabled: 0
build_args: -ldflags "-s -w"
build_tags: darwin-arm64

release-mac-amd64:
name: release darwin/amd64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: darwin
goarch: amd64
cgo_enabled: 0
build_args: -ldflags "-s -w"
build_tags: darwin-arm64
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work
go.work.sum

.DS_Store
3 changes: 2 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Copyright © 2024 Kerim Kaan Dönmez <[email protected]>
package cmd

import (
"genius/constants"
"os"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -32,7 +33,7 @@ func init() {
// Here you will define your flags and configuration settings.
// Cobra supports persistent flags, which, if defined here,
// will be global for your application.

rootCmd.Version = constants.VERSION
// rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.genius.yaml)")

// Cobra also supports local flags, which will only run
Expand Down
9 changes: 9 additions & 0 deletions constants/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package constants

const (
// Version is the current version of the application
VERSION = "0.0.2"
MAJOR = 0
MINOR = 0
PATCH = 2
)

0 comments on commit 1281a33

Please sign in to comment.