File tree Expand file tree Collapse file tree 4 files changed +10
-23
lines changed
Expand file tree Collapse file tree 4 files changed +10
-23
lines changed Original file line number Diff line number Diff line change 4343 mkdir -p dist
4444 ext=""
4545 if [ "${{ matrix.os }}" = "windows" ]; then ext=".exe"; fi
46- GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o dist/${FILENAME}${ext}
46+ VERSION="${{ needs.release-please.outputs.tag_name }}"
47+ LDFLAGS="-ldflags -X github.com/rose-pine/rose-pine-bloom/cmd.version=${VERSION}"
48+ GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build ${LDFLAGS} -o dist/${FILENAME}${ext}
4749 - name : Upload to GitHub Release
4850 env :
4951 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 44 "fmt"
55
66 "github.com/rose-pine/rose-pine-bloom/docs"
7- "github.com/rose-pine/rose-pine-bloom/version"
87 "github.com/spf13/cobra"
98)
109
@@ -15,7 +14,7 @@ var initCmd = &cobra.Command{
1514 Run : func (cmd * cobra.Command , args []string ) {
1615 // TODO the command is not clear at this point
1716 buildCmd := "bloom TODO"
18- if err := docs .EnsureReadmeWithBuildCommand (buildCmd , version . GetCurrentVersion () ); err != nil {
17+ if err := docs .EnsureReadmeWithBuildCommand (buildCmd , version ); err != nil {
1918 fmt .Println ("unable to update README:" , err )
2019 }
2120
Original file line number Diff line number Diff line change @@ -3,10 +3,14 @@ package cmd
33import (
44 "os"
55
6- "github.com/rose-pine/rose-pine-bloom/version"
76 "github.com/spf13/cobra"
87)
98
9+ var (
10+ // version will be set at build time using -ldflags
11+ version = "dev"
12+ )
13+
1014var rootCmd = & cobra.Command {
1115 Use : "bloom" ,
1216 Short : "The Rosé Pine theme generator" ,
@@ -19,7 +23,7 @@ var rootCmd = &cobra.Command{
1923// Execute adds all child commands to the root command and sets flags appropriately.
2024// This is called by main.main(). It only needs to happen once to the rootCmd.
2125func Execute () {
22- rootCmd .Version = version . GetCurrentVersion ()
26+ rootCmd .Version = version
2327
2428 err := rootCmd .Execute ()
2529 if err != nil {
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments