The GBM CLI tool helps developmental tasks for managing Gutenberg Mobile releases.
The current features include:
- Command to generate the release checklist
- Commands to wrangle Gutenberg Mobile releases
Check the latest release in this repository for the binary builds. Currently we only build for MacOS arm64 (apple silicon). The script has only been tested on apple silicon but builds of other platforms should work as expected. See the official go build documentation for alternative builds.
If using apple silicon, download the gbm-cli
binary from the latest release
Place the executable in your $PATH
and reload your shell. Try
$ gbm-cli --version
To verify installation.
If go
(above version 1.21
) is installed you can also use:
go install github.com/wordpress-mobile/release-toolkit-gutenberg-mobile/gbm-cli@latest
This will build and install the executable in the GOPATH
on your machine.
Note: Verify that GOPATH
is set before using this method. If it's not set run export GOPATH=$HOME/go
before calling go install
The tool uses the same Github authentication as gh
. If gh
is installed and authorized there is no need to do anything else.
Otherwise follow these steps:
- Create a personal access token
- Export the token under the environment variable
GH_TOKEN
- Download and install the Go package. Check
go.mod
for the current version of go required (Note: anything belowv1.21
will not work) - While not required, it is highly recommended to develop with VSCode and install the Go VSCode extension.
Check the Releasing doc for more information on creating Gutenberg Mobile releases. Use the following for creating new releases of the CLI tool
When ready to push updates to a new gbm-cli
version make sure to:
- Increment the version in
./cmd/root.go
- Merge the PR with the version bump
- Create a new Github Release with the updated version.
- Locally checkout the release tag
- Create a
./bin
directory if you don't have one already - Run
go build -o ./bin/gbm-cli
- Add
./bin/gbm-cli
as an artifact to the Github release.
For detailed instructions on testing and configuring your development environment, visit Testing.md.
The project is setup wth the following directories:
The cmd
directory defines the various cli commands that make up the CLI took. Under the hood gbm
uses go-cobra.
The packages in pkg
are intended as the "public" interface for the tool. The are primarily used by the cmd
packages but could be used by other go projects.
The template files in this directory are embedded into the go binary. The can be accessed by using templates
as the root path segment.
For example using the render package:
// this can be called anywhere in the project
checklist := render.Render("template/checklist/checklist.html", data, funcs)