Skip to content
This repository was archived by the owner on Apr 29, 2024. It is now read-only.

Commit 9dfcd18

Browse files
committed
Update README.md
1 parent cf5b0e1 commit 9dfcd18

File tree

1 file changed

+163
-1
lines changed

1 file changed

+163
-1
lines changed

README.md

Lines changed: 163 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,164 @@
11
# sentry-release-deploy-action
2-
A GitHub action that creates a deploy for a Sentry.io release.
2+
3+
[![license](https://img.shields.io/github/license/tclindner/sentry-release-deploy-action.svg?maxAge=2592000&style=flat-square)](https://github.com/tclindner/sentry-release-deploy-action/blob/master/LICENSE)
4+
<a href="https://github.com/tclindner/sentry-release-deploy-action"><img alt="GitHub Actions status" src="https://github.com/tclindner/sentry-release-deploy-action/workflows/ci/badge.svg"></a>
5+
[![Dependency Status](https://david-dm.org/tclindner/sentry-release-deploy-action.svg?style=flat-square)](https://david-dm.org/tclindner/sentry-release-deploy-action)
6+
[![devDependency Status](https://david-dm.org/tclindner/sentry-release-deploy-action/dev-status.svg?style=flat-square)](https://david-dm.org/tclindner/sentry-release-deploy-action#info=devDependencies)
7+
8+
> A GitHub action that creates a [deploy for a Sentry.io release](https://docs.sentry.io/api/releases/post-release-deploys/).
9+
10+
## What is sentry-release-deploy-action?
11+
12+
A GitHub action that makes is easy to create a deploy for an existing release in Sentry.io based on events in GitHub. Examples:
13+
14+
* a GitHub release is published
15+
* a commit is pushed to master
16+
* a pull request is merged to master
17+
18+
## How does it differ from sentry-releases-action?
19+
20+
[sentry-releases-action](https://github.com/tclindner/sentry-releases-action) is used to create a new release, deploy it, associate commits, and finalize a release. sentry-releases-action should be used to create a release. This action is different because it only creates a deploy for an existing release.
21+
22+
## How do I use it?
23+
24+
First thing first, let's make sure you have the necessary pre-requisites.
25+
26+
### Pre-requisites
27+
Create a workflow `.yml` file in your repo's `.github/workflows` directory. An [example workflow](#example-workflow---create-a-release) is available below. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).
28+
29+
### Inputs
30+
31+
#### `version`
32+
33+
**Required** The version being deployed. You can optionally prefix it using `versionPrefix`.
34+
35+
#### `environment`
36+
37+
**Required** The name of the environment the release was deployed to.
38+
39+
#### `versionPrefix`
40+
41+
**Optional** String that is prefixed to the version to form the Sentry release name.
42+
43+
> Please review Sentry's documentation regarding max length and supported characters in release names.
44+
45+
For more information on these inputs, see the [API Documentation](https://developer.github.com/v3/repos/releases/#input)
46+
47+
### Environment Variables
48+
49+
#### `SENTRY_AUTH_TOKEN`
50+
51+
**Required** Sentry auth token.
52+
53+
#### `SENTRY_ORG`
54+
55+
**Required** Sentry organization.
56+
57+
#### `SENTRY_PROJECT`
58+
59+
**Required** Sentry project name.
60+
61+
#### `SENTRY_URL`
62+
63+
**Optional** URL to the Sentry instance, useful for e.g. on-prem deployments.
64+
65+
## Example usage
66+
67+
```yml
68+
name: Create a deploy for a Sentry.io release
69+
uses: tclindner/[email protected]
70+
env:
71+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
72+
SENTRY_ORG: myAwesomeOrg
73+
SENTRY_PROJECT: myAwesomeProject
74+
with:
75+
version: ${{ github.ref }}
76+
environment: qa
77+
```
78+
79+
> Note: `sentry-release-deploy-action` will automatically trim `refs/tags/` from `version` if a tag ref is passed. This means you can pass `GITHUB_REF` directly from release events without the need of mutating it first.
80+
81+
### Full example workflow
82+
83+
On every GitHub `release` event.
84+
85+
```yaml
86+
name: ReleaseWorkflow
87+
88+
on:
89+
release:
90+
types: [published, prereleased]
91+
92+
93+
jobs:
94+
releaseApp:
95+
runs-on: ubuntu-latest
96+
steps:
97+
- name: Checkout code
98+
uses: actions/checkout@master
99+
- name: Deploy to dev
100+
uses: Your action for deployment
101+
- name: Create a Sentry.io release
102+
uses: tclindner/[email protected]
103+
env:
104+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
105+
SENTRY_ORG: myAwesomeOrg
106+
SENTRY_PROJECT: myAwesomeProject
107+
with:
108+
tagName: ${{ github.ref }}
109+
environment: dev
110+
- name: Run integration tests against dev
111+
uses: Your action for testing
112+
- name: Deploy to qa
113+
uses: Your action for deployment
114+
- name: Create a deploy for a Sentry.io release
115+
uses: tclindner/[email protected]
116+
env:
117+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
118+
SENTRY_ORG: myAwesomeOrg
119+
SENTRY_PROJECT: myAwesomeProject
120+
with:
121+
version: ${{ github.ref }}
122+
environment: qa
123+
- name: Run integration tests against qa
124+
uses: Your action for testing
125+
```
126+
127+
Assume you tagged your release as `v1.1.0`. `github.ref` would equal `refs/tags/v1.1.0`. This action automatically strips `refs/tags/`, so the Sentry release name is `v1.1.0`.
128+
129+
### Example with optional release prefix
130+
131+
```yaml
132+
name: Create a deploy for a Sentry.io release
133+
uses: tclindner/[email protected]
134+
env:
135+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
136+
SENTRY_ORG: myAwesomeOrg
137+
SENTRY_PROJECT: myAwesomeProject
138+
with:
139+
version: ${{ github.ref }}
140+
environment: qa
141+
versionPrefix: myAwesomeProject-
142+
```
143+
144+
Scenario 1: Assume you tagged your release as `v1.1.0`. `github.ref` would equal `refs/tags/v1.1.0`. This action automatically strips `refs/tags/`, so the Sentry release name is `myAwesomeProject-v1.1.0`.
145+
146+
Scenario 2: Assume you tagged your release as `1.1.0` and you set `releaseNamePrefix` to `myAwesomeProject@`. `github.ref` would equal `refs/tags/1.1.0`. This action automatically strips `refs/tags/`, so the Sentry release name is `[email protected]`.
147+
148+
> Note: This action only works on Linux x86_64 systems.
149+
150+
## Related
151+
152+
[sentry-releases-action](https://github.com/tclindner/sentry-releases-action) - Action used to create releases. This action should be used first in your CI workflow.
153+
154+
## Contributing
155+
156+
Please see [CONTRIBUTING.md](CONTRIBUTING.md).
157+
158+
## Release History
159+
160+
Please see [CHANGELOG.md](CHANGELOG.md).
161+
162+
## License
163+
164+
Copyright (c) 2020 Thomas Lindner. Licensed under the MIT license.

0 commit comments

Comments
 (0)