Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ $ ./out/auth0 --help

This part is not fully fleshed out yet, but here are the steps:

1. Create a command (example: https://github.com/auth0/auth0-cli/blob/main/internal/cli/login.go)
2. Add the command constructor to the root command: (e.g. somewhere here: https://github.com/auth0/auth0-cli/blob/main/internal/cli/root.go)
1. Create a command (example: https://github.com/auth0/auth0-cli/blob/beta/internal/cli/login.go)
2. Add the command constructor to the root command: (e.g. somewhere here: https://github.com/auth0/auth0-cli/blob/beta/internal/cli/root.go)

Test it out by doing:

Expand All @@ -60,22 +60,23 @@ 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)
- create the pre-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:
> **Note:** Homebrew and Scoop are not updated for beta releases.

To release a new beta version:

1. pull the latest changes:
- `$ git checkout main`
- `$ git pull origin main`
- `$ git checkout beta`
- `$ git pull origin beta`
2. check the latest tag:
- `$ git fetch`
- `$ git tags`
3. 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 create `v0.1.2`:
- `$ git tag v0.1.2`
- `$ git tag --list`
3. create the **new** beta tag. Beta releases use the format `vX.Y.Z-beta.N`. For example, if the latest tag is `v1.32.0-beta.1` and you want the next beta, create `v1.32.0-beta.2`:
- `$ git tag v1.32.0-beta.2`
4. push the new tag:
- `$ git push origin v0.1.2`
- `$ git push origin v1.32.0-beta.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.
37 changes: 24 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@
[![Go Report Card](https://goreportcard.com/badge/github.com/auth0/auth0-cli?style=flat-square)](https://goreportcard.com/report/github.com/auth0/auth0-cli)
[![Release](https://img.shields.io/github/v/release/auth0/auth0-cli?logo=auth0&include_prereleases&style=flat-square)](https://github.com/auth0/auth0-cli/releases)
[![Codecov](https://img.shields.io/codecov/c/github/auth0/auth0-cli?logo=codecov&style=flat-square)](https://codecov.io/gh/auth0/auth0-cli)
[![License](https://img.shields.io/github/license/auth0/auth0-cli.svg?logo=fossa&style=flat-square)](https://github.com/auth0/auth0-cli/blob/main/LICENSE)
[![Build Status](https://img.shields.io/github/actions/workflow/status/auth0/auth0-cli/go.yml?branch=main&style=flat-square&logo=github)](https://github.com/auth0/auth0-cli/actions?query=branch%3Amain)
[![License](https://img.shields.io/github/license/auth0/auth0-cli.svg?logo=fossa&style=flat-square)](https://github.com/auth0/auth0-cli/blob/beta/LICENSE)
[![Build Status](https://img.shields.io/github/actions/workflow/status/auth0/auth0-cli/go.yml?branch=beta&style=flat-square&logo=github)](https://github.com/auth0/auth0-cli/actions?query=branch%3Abeta)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/auth0/auth0-cli)

</div>

---

> [!WARNING]
> This is a **beta release** of the Auth0 CLI and is not yet generally available. Features and behavior may change before the final release.

> [!WARNING]
> The beta release does not fully support the interactive **device authorization** login flow (`auth0 login` as a user). We recommend authenticating with **machine-to-machine (M2M)** client credentials while using the beta. See [Authenticating to Your Tenant](#authenticating-to-your-tenant) for details.

Build, manage and test your [Auth0](https://auth0.com/) integrations from the command line.

![demo](./demo.gif)
Expand All @@ -39,14 +45,17 @@ Build, manage and test your [Auth0](https://auth0.com/) integrations from the co
Install via [Homebrew](https://brew.sh/):

```bash
brew tap auth0/auth0-cli && brew install auth0
brew tap auth0/auth0-cli && brew install auth0-beta
```

> [!NOTE]
> The `auth0-beta` formula installs the beta build as the `auth0` binary. Run it with `auth0` once installed.

Install via [cURL](https://curl.se/):

1. Download the binary. It will be placed in `./auth0`:
```bash
curl -sSfL https://raw.githubusercontent.com/auth0/auth0-cli/main/install.sh | sh -s -- -b .
curl -sSfL https://raw.githubusercontent.com/auth0/auth0-cli/beta/install.sh | sh -s -- -b .
```
2. Optionally, if you want to be able to run the binary from any directory, make sure you move it to a place in your $PATH:
```bash
Expand All @@ -61,15 +70,17 @@ Install via [Scoop](https://scoop.sh/):

```bash
scoop bucket add auth0 https://github.com/auth0/scoop-auth0-cli.git
scoop install auth0
scoop install auth0-beta
```

> [!NOTE]
> The `auth0-beta` manifest installs the beta build as the `auth0` binary. Run it with `auth0` once installed.

Install via [Powershell](https://learn.microsoft.com/en-us/powershell/):

1. Fetch latest release information with the following commands:
1. Fetch the latest beta release information with the following commands:
```powershell
$latestRelease = Invoke-RestMethod -Uri "https://api.github.com/repos/auth0/auth0-cli/releases/latest"
$latestRelease = (Invoke-RestMethod -Uri "https://api.github.com/repos/auth0/auth0-cli/releases") | Where-Object { $_.prerelease -eq $true } | Select-Object -First 1
$latestVersion = $latestRelease.tag_name
$version = $latestVersion -replace "^v"
```
Expand All @@ -91,12 +102,14 @@ Install via [Go](https://go.dev/):
```bash
# Make sure your $GOPATH/bin is exported on your $PATH
# to be able to run the binary from any directory.
go install github.com/auth0/auth0-cli/cmd/auth0@latest
# Replace <beta-tag> with the latest beta release tag (e.g. v1.33.0-beta.1).
# See https://github.com/auth0/auth0-cli/releases for available tags.
go install github.com/auth0/auth0-cli/cmd/auth0@<beta-tag>
```

### Manual

1. Download the appropriate binary for your environment from the [latest release](https://github.com/auth0/auth0-cli/releases/latest/)
1. Download the appropriate binary for your environment from the [releases page](https://github.com/auth0/auth0-cli/releases) — select the most recent pre-release
2. Extract the archive
- **macOS**: `$ tar -xf auth0-cli_{version}_Darwin_{architecture}.tar.gz`
- **Linux**: `$ tar -xf auth0-cli_{version}_Linux_{architecture}.tar.gz`
Expand Down Expand Up @@ -139,8 +152,6 @@ There are two ways to authenticate:
- **As a user** - Recommended when invoking on a personal machine or other interactive environment. Facilitated by [device authorization](https://auth0.com/docs/get-started/authentication-and-authorization-flow/device-authorization-flow) flow and cannot be used for private cloud tenants.
- **As a machine** - Recommended when running on a server or non-interactive environments (ex: CI, authenticating to a **private cloud**). Facilitated by [client credentials](https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-credentials-flow) flow. Flags available for bypassing interactive shell.



> **Warning**
> Authenticating as a user is not supported for **private cloud** tenants.
> Instead, those users should authenticate with client credentials.
Expand Down Expand Up @@ -282,7 +293,7 @@ We appreciate feedback and contribution to this repo! Before you get started, pl

- [Auth0's general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)
- [Auth0's code of conduct guidelines](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)
- [This repo's contribution guide](https://github.com/auth0/auth0-cli/blob/main/CONTRIBUTING.md)
- [This repo's contribution guide](https://github.com/auth0/auth0-cli/blob/beta/CONTRIBUTING.md)

### Raise an issue

Expand All @@ -303,4 +314,4 @@ Please do not report security vulnerabilities on the public GitHub issue tracker
</p>
<p align="center">Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout <a href="https://auth0.com/why-auth0">Why Auth0?</a></p>
<p align="center">
This project is licensed under the MIT license. See the <a href="https://github.com/auth0/auth0-cli/blob/main/LICENSE"> LICENSE</a> file for more info.</p>
This project is licensed under the MIT license. See the <a href="https://github.com/auth0/auth0-cli/blob/beta/LICENSE"> LICENSE</a> file for more info.</p>
18 changes: 15 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Usage: $this [-b] bindir [-d] [tag]
-d turns on debug logging
[tag] is a tag from
https://github.com/auth0/auth0-cli/releases
If tag is missing, then the latest will be used.
If tag is missing, then the latest beta (pre-release) will be used.

Generated by godownloader
https://github.com/goreleaser/godownloader
Expand Down Expand Up @@ -296,11 +296,23 @@ http_copy() {
github_release() {
owner_repo=$1
version=$2
test -z "$version" && version="latest"
if test -z "$version"; then
# Fetch the list of releases and pick the first pre-release (beta)
apiurl="https://api.github.com/repos/${owner_repo}/releases"
json=$(http_copy "$apiurl" "Accept:application/json")
test -z "$json" && return 1
version=$(echo "$json" | tr -s '\n' ' ' | grep -o '"tag_name": *"[^"]*"[^{]*"prerelease": *true' | head -1 | sed 's/.*"tag_name": *"//;s/".*//')
if test -z "$version"; then
log_crit "unable to find a pre-release - see https://github.com/${owner_repo}/releases for available beta releases"
return 1
fi
echo "$version"
return 0
fi
giturl="https://github.com/${owner_repo}/releases/${version}"
json=$(http_copy "$giturl" "Accept:application/json")
test -z "$json" && return 1
version=$(echo "$json" | tr -s '\n' ' ' | sed 's/.*"tag_name":"//' | sed 's/".*//')
version=$(echo "$json" | tr -s '\n' ' ' | sed 's/.*"tag_name": *"//' | sed 's/".*//')
test -z "$version" && return 1
echo "$version"
}
Expand Down
Loading