|
| 1 | +# mathrix-education/setup-sentry-cli |
| 2 | +Install the Sentry CLI in your GitHub Actions workflow. |
| 3 | + |
| 4 | +**This action is not supported by Sentry.** |
| 5 | + |
| 6 | +Proudly maintained by [Mathieu Bour][1.1], Vice-CTO |
| 7 | +[@mathrix-education][1.2]. |
| 8 | + |
| 9 | +[1.1]: https://github.com/mathieu-bour |
| 10 | +[1.2]: https://github.com/mathrix-education |
| 11 | + |
| 12 | +## Motivations |
| 13 | +Installing Sentry CLI in GitHub Actions can be relevant in many cases. |
| 14 | +Mathrix Education SA is based on Angular, which produces sourcemaps. |
| 15 | +Therefore, we need to upload sourcemaps, during our compilation |
| 16 | +workflow. |
| 17 | + |
| 18 | +There is an |
| 19 | +[official guide to use sentry-cli on the Sentry's blog][2.1], |
| 20 | +but it requires to use a bunch of commands, which is not really |
| 21 | +straight forward. |
| 22 | + |
| 23 | +There are also some [Docker-based actions][2.2], but they are quite |
| 24 | +slow. |
| 25 | + |
| 26 | +[2.1]: https://blog.sentry.io/2019/12/17/using-github-actions-to-create-sentry-releases |
| 27 | +[2.2]: https://github.com/marketplace?type=actions&query=sentry |
| 28 | + |
| 29 | + |
| 30 | +## Usage |
| 31 | +### Supported operating systems |
| 32 | +This action currently supports Ubuntu, Windows and Mac-OS based systems. |
| 33 | +The supported operating systems matrix is the following: |
| 34 | + |
| 35 | +| Operating system | Status | |
| 36 | +|------------------|-------| |
| 37 | +| `ubuntu-latest` | ![3.1] | |
| 38 | +| `macos-latest` | ![3.1] | |
| 39 | +| `windows-latest` | ![3.1] | |
| 40 | + |
| 41 | +[3.1]: https://img.shields.io/badge/status-supported-brightgreen |
| 42 | + |
| 43 | +### Inputs |
| 44 | +| Name | Type | Default value | |
| 45 | +|----------------|-----------------------|---------------| |
| 46 | +| `version` | `'latest'` / `string` | `'latest'` | |
| 47 | +| `token` | `string` | `''` | |
| 48 | +| `url` | `string` | `''` | |
| 49 | +| `organization` | `string` | `''` | |
| 50 | +| `project` | `string` | `''` | |
| 51 | + |
| 52 | +See [action.yml](action.yml) for details. |
| 53 | + |
| 54 | +#### `version` |
| 55 | +If you need a precise version of the Sentry CLI, you may provide this |
| 56 | +input. We strongly advise you to do so since using the latest version |
| 57 | +may break your workflow if Sentry releases a backward-incompatible |
| 58 | +version. |
| 59 | + |
| 60 | +#### `url` |
| 61 | +The Sentry server URL. By default, this action will configure the |
| 62 | +Sentry CLI to interact with official Sentry server which is |
| 63 | +`https://sentry.io`. If you use an on-premise instance, you may provide |
| 64 | +your server URL here. |
| 65 | + |
| 66 | +#### `token` |
| 67 | +This is the token which will be used by the Sentry CLI to authenticate |
| 68 | +against the Sentry server. |
| 69 | +You may generate it on your personal account page. |
| 70 | + |
| 71 | +#### `organization` |
| 72 | +Define the default organization. |
| 73 | + |
| 74 | +#### `project` |
| 75 | +Define the default project. |
| 76 | + |
| 77 | +## Examples |
| 78 | +### Minimal configuration |
| 79 | +```yaml |
| 80 | +- uses: mathrix-education/setup-sentry-cli@master |
| 81 | +``` |
| 82 | +By default, this minimal example will install the latest version of the |
| 83 | +Sentry CLI, without any authentication. |
| 84 | +
|
| 85 | +### Typical CI configuration |
| 86 | +```yaml |
| 87 | +- name: Setup Sentry CLI |
| 88 | + uses: mathrix-education/setup-sentry-cli@0.1.0 |
| 89 | + with: |
| 90 | + version: latest # optional if 'latest' |
| 91 | + url: https://sentry.yourcompany.com |
| 92 | + auth: ${{ SECRETS.SENTRY_TOKEN }} # from GitHub secrets |
| 93 | + organization: my-org |
| 94 | + project: my-project |
| 95 | +``` |
| 96 | +In this example, you provide a authentication token. The action |
| 97 | +automatically download the latest version of the Sentry CLI and |
| 98 | +authenticate using the provided token. |
| 99 | +
|
| 100 | +Then, the CLI is configured for the server |
| 101 | +`https://sentry.yourcompany.com` and the project `my-project` of the |
| 102 | +organization `my-org`. |
| 103 | + |
| 104 | +You are now ready to use the Sentry CLI commands such as |
| 105 | +`sentry-cli releases`! |
0 commit comments