- Setup go
- Clone this repo:
git clone [email protected]:auth0/auth0-cli
make test
- ensure everything works correctly. Should see things pass.
From the top-level directory:
$ make build
$ ./out/auth0 --help
This part is not fully fleshed out yet, but here are the steps:
- Create a command (example: https://github.com/auth0/auth0-cli/blob/main/internal/cli/login.go)
- Add the command constructor to the root command: (e.g. somewhere here: https://github.com/auth0/auth0-cli/blob/main/internal/cli/root.go)
Test it out by doing:
go run ./cmd/auth0 <your command>
If you have to add another go dependency, you can follow the steps:
go get -u github.com/some/path/to/lib
- Import the library you need in the relevant file. (This step is necessary, so
the next steps informs
go mod
that this dependency is actually used). - go mod tidy
- go mod vendor
We use vendoring, so the last step is required.
This is only possible if you're a repository maintainer.
The release is driven by a GitHub workflow triggered when a new tag is created. The workflow will run the checks and trigger Goreleaser to:
- create the Release with the proper description (changelog)
- upload the binaries for the different architectures
- update https://github.com/auth0/homebrew-auth0-cli with the latest binary reference
To release a new version:
- pull the latest changes:
$ git checkout main
$ git pull origin main
- check the latest tag:
$ git fetch
$ git tags
- create the new tag for the new release. For example, if the latest tag is
v0.1.1
and you want to release a patch version, you should createv0.1.2
:$ git tag v0.1.2
- push the new tag:
$ git push origin v0.1.2
The rest of the process will take place in the github action: https://github.com/auth0/auth0-cli/actions/workflows/goreleaser.yml. Once the workflow finishes, a new release will be available for the newly created tag.