Skip to content

Commit

Permalink
Merge pull-request #44
Browse files Browse the repository at this point in the history
  • Loading branch information
r-n-o committed Oct 17, 2023
2 parents a938426 + 2f1f932 commit bf79bbb
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 56 deletions.
13 changes: 5 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
include $(PWD)/src/toolchain/Makefile

VERSION ?= $(shell git describe --tag --always --dirty --match 'v[0-9]*' --abbrev=8)

KEYS := \
6B61ECD76088748C70590D55E90A401336C8AAA9 \
A8864A8303994E3A18ACD1760CAB4418C834B102 \
Expand All @@ -16,7 +18,6 @@ LOCAL_BUILD_DIR := 'build'
.PHONY: default
default: \
toolchain \
version \
$(DEFAULT_GOAL) \
$(patsubst %,$(KEY_DIR)/%.asc,$(KEYS)) \
$(OUT_DIR)/turnkey.linux-x86_64 \
Expand All @@ -43,12 +44,6 @@ test: $(OUT_DIR)/turnkey.linux-x86_64
env -C $(SRC_DIR) go test -v ./cmd/turnkey/... \
')

.PHONY: version
version:
mkdir -p src/internal/version/data
git describe --tag --always --dirty --match v[0-9]\* --abbrev=8 > src/internal/version/data/version
git rev-parse HEAD > src/internal/version/data/commit

.PHONY: install
install: default
mkdir -p ~/.local/bin
Expand Down Expand Up @@ -90,8 +85,10 @@ $(OUT_DIR)/turnkey.%:
CGO_ENABLED=0 \
env -C $(SRC_DIR) \
go build \
-ldflags "-X github.com/tkhq/tkcli/src/cmd/turnkey/pkg.versionString=$(VERSION)" \
-trimpath \
-o /home/build/$@ ./cmd/turnkey/ \
-o /home/build/$@ \
./cmd/turnkey/ \
')

.PHONY: build-local
Expand Down
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,16 +238,34 @@ Note that you may need to do the following:
To release a new version of the CLI:
Determine the next version:
```sh
git tag | sort -n | tail -n5
```
Export your new version:
```sh
export VERSION=vX.Y.Z
```
Build the release artifacts:
```sh
$ make VERSION=vX.Y.Z dist
$ make VERSION=$VERSION dist
```
This will produce a new set of artifact in the `dist/` directory, along with a new manifest.
Cut a new release branch:
```sh
$ git branch -b release-$VERSION
```
Open a pull request, and once you have enough approvals, tag the release:
```sh
$ git tag -sa vX.Y.Z -m "New release: X.Y.Z"
$ git tag -sa $VERSION -m "New release: $VERSION"
```
Finally, update the download table above, with links pointing to the new binaries.
Expand Down
10 changes: 5 additions & 5 deletions dist/Formula/turnkey.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
class Turnkey < Formula
desc "Turnkey CLI"
homepage "https://github.com/tkhq/tkcli"
version "v1.0.2"
version "v1.0.3"
license "Apache License 2.0"

if Hardware::CPU.arm?
url "https://github.com/tkhq/tkcli/raw/v1.0.2/dist/turnkey.darwin-aarch64", using: CurlDownloadStrategy
sha256 "c5cba5ecebe7ac394afaffc2e171708369e829692c3e2efaeb60ada236c8d974"
url "https://github.com/tkhq/tkcli/raw/v1.0.3/dist/turnkey.darwin-aarch64", using: CurlDownloadStrategy
sha256 "f7689f57693b524f223b34175c0278267f74b6831464386038d0ee17ee546eff"

def install
bin.install "turnkey.darwin-aarch64" => "turnkey"
end
end
if Hardware::CPU.intel?
url "https://github.com/tkhq/tkcli/raw/v1.0.2/dist/turnkey.darwin-x86_64", using: CurlDownloadStrategy
sha256 "8d5f1d5315db97801f9266fa60fb45ca600b2e95b1782fdd7886c23bfb109fed"
url "https://github.com/tkhq/tkcli/raw/v1.0.3/dist/turnkey.darwin-x86_64", using: CurlDownloadStrategy
sha256 "07ffe737d5948b401e05a8d38fabedbd063f8ec69dda7d78084377ae65e5c014"

def install
bin.install "turnkey.darwin-x86_64" => "turnkey"
Expand Down
12 changes: 6 additions & 6 deletions dist/manifest.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
113819f3b86197f192c3a974df90596ed254906448c127d4a2769641842f5fa9 Formula/turnkey.rb
6b9f887e3893217bdb3e3803f81a36729c67f0aeb611074be7021d997da1a5ff release.env
c5cba5ecebe7ac394afaffc2e171708369e829692c3e2efaeb60ada236c8d974 turnkey.darwin-aarch64
8d5f1d5315db97801f9266fa60fb45ca600b2e95b1782fdd7886c23bfb109fed turnkey.darwin-x86_64
48cb3e3db287902112b3b001033c90426b45991e2309ee780c0c7a3dc2c6197d turnkey.linux-aarch64
0c6036b7b2c1863aed6790338472dffc0cfbc9c51a9aa9b015402aa508afed33 turnkey.linux-x86_64
b4fa938c49517315896f35a63ec84c66f949b7eaab579c5e86917d9fa7c685d9 Formula/turnkey.rb
058ae48aa5d85624b20cc02d15a36bb5402d867d8c4d3279f811fc813e3ba9f9 release.env
f7689f57693b524f223b34175c0278267f74b6831464386038d0ee17ee546eff turnkey.darwin-aarch64
07ffe737d5948b401e05a8d38fabedbd063f8ec69dda7d78084377ae65e5c014 turnkey.darwin-x86_64
f586683a4ecb6bf0f0c7f08ee64dfb41c20978f5e17c947d400973735f4e474a turnkey.linux-aarch64
0329274a526d1d5d631a798be123097ab17c4d3205a7e71af6f8dbabd4cf4b0c turnkey.linux-x86_64
10 changes: 5 additions & 5 deletions dist/release.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION=v1.0.2
GIT_REF=5e2c831e76f9166b3c402f442e6714911c4133d4
GIT_AUTHOR=Arnaud Brousseau
GIT_KEY=68705ACF41E8ECDEE2925A424AAB800CFFA3065A
GIT_TIMESTAMP=2023-05-24 16:10:24 -0500
VERSION=v1.0.3
GIT_REF=cd7020e08beb88db81c11427e0e8c85779f26ee0
GIT_AUTHOR=Seán C McCord
GIT_KEY=39B2095B61DD23EEE1BF883A8A1F048490D23AFD
GIT_TIMESTAMP=2023-10-17 12:28:02 -0400
4 changes: 2 additions & 2 deletions dist/turnkey.darwin-aarch64
Git LFS file not shown
4 changes: 2 additions & 2 deletions dist/turnkey.darwin-x86_64
Git LFS file not shown
4 changes: 2 additions & 2 deletions dist/turnkey.linux-aarch64
Git LFS file not shown
4 changes: 2 additions & 2 deletions dist/turnkey.linux-x86_64
Git LFS file not shown
7 changes: 3 additions & 4 deletions src/cmd/turnkey/pkg/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"fmt"

"github.com/spf13/cobra"

"github.com/tkhq/tkcli/src/internal/version"
)

var versionString string

func init() {
rootCmd.AddCommand(versionCmd)
}
Expand All @@ -16,7 +16,6 @@ var versionCmd = &cobra.Command{
Use: "version",
Short: "display build and version information",
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("Version: %s", version.Version)
fmt.Printf("Commit: %s", version.Commit)
fmt.Println(versionString)
},
}
1 change: 0 additions & 1 deletion src/internal/version/data/commit

This file was deleted.

1 change: 0 additions & 1 deletion src/internal/version/data/version

This file was deleted.

15 changes: 0 additions & 15 deletions src/internal/version/version.go

This file was deleted.

0 comments on commit bf79bbb

Please sign in to comment.