Skip to content

Commit

Permalink
versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWoolfenden committed Jun 15, 2023
1 parent 135ecb3 commit ef495c6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: 1.20
go-version: 1.19
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@72b6676b71ab476b77e676928516f6982eef7a41 # v5.3.0
Expand Down
5 changes: 2 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

before:
hooks:
- ./set-version.sh
- ./set-version.sh

builds:
- goos:
Expand All @@ -24,8 +24,7 @@ archives:
format: zip

brews:
-
name: sato
- name: sato

tap:
owner: JamesWoolfenden
Expand Down
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
_ "embed" // required for embed
"fmt"
"os"
"sato/src/version"
"sort"
"time"

Expand Down Expand Up @@ -65,7 +66,7 @@ func main() {
UsageText: "sato version",
Action: func(*cli.Context) error {
//goland:noinspection GoLinter
fmt.Println(cf.Version)
fmt.Println(version.Version)

return nil
},
Expand Down Expand Up @@ -125,7 +126,7 @@ func main() {
Usage: "Translate Cloudformation to Terraform",
Compiled: time.Time{},
Authors: []*cli.Author{{Name: "James Woolfenden", Email: "jim.wolf@duck.com"}},
Version: cf.Version,
Version: version.Version,
}
sort.Sort(cli.FlagsByName(app.Flags))
sort.Sort(cli.CommandsByName(app.Commands))
Expand Down
6 changes: 3 additions & 3 deletions set-version.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
latesttag=$(git describe --tags)
echo "Updating version file with new tag: $latesttag"
echo "package sato" > src/version.go
echo "" >> src/cf/version.go
echo "const Version = \"$latesttag\"" >> src/cf/version.go
echo "package version" > src/version/version.go
echo "" >> src/version/version.go
echo "const Version = \"$latesttag\"" >> src/version/version.go
2 changes: 1 addition & 1 deletion src/cf/version.go → src/version/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cf
package version

// Version controls the applications version.
const Version = "9.9.9"

0 comments on commit ef495c6

Please sign in to comment.