This adds the ability to self update the cli tool.
Why?
Apple requires code signing for all binaries, making it tricky to download the gbm-cli tool directly from the github releases pages. This change will make it easy for release wranglers to update the tool.
Testing
Change the version in ./gbm-cli/cmd/root.go to a lower version (current is 1.5.0), example patch:
diff --git a/gbm-cli/cmd/root.go b/gbm-cli/cmd/root.go
index e921336..a7fefb9 100644
--- a/gbm-cli/cmd/root.go
+++ b/gbm-cli/cmd/root.go
@@ -8,7 +8,7 @@ import (
"github.com/wordpress-mobile/release-toolkit-gutenberg-mobile/gbm-cli/pkg/console"
)
-const Version = "v1.5.0"
+const Version = "v1.4.0"
// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Run go build -o ./bin/gbm-cli
Run ./bin/gbm-cli --version
Cancel the option to update and note the version number. It should be the value added in the first step
Run ./bin/gbm-cli --version again
Accept the offer to update
Note that the version message shows the latest version in Github
This adds the ability to self update the cli tool.
Why?
Apple requires code signing for all binaries, making it tricky to download the
gbm-cli
tool directly from the github releases pages. This change will make it easy for release wranglers to update the tool.Testing
./gbm-cli/cmd/root.go
to a lower version (current is 1.5.0), example patch:go build -o ./bin/gbm-cli
./bin/gbm-cli --version
./bin/gbm-cli --version
again./bin/gbm-cli --version
again