generated from getsentry/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathaction.yml
209 lines (202 loc) · 7.98 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
name: 'Sentry Release'
description: 'GitHub Action for creating a release on Sentry'
author: 'Sentry'
inputs:
environment:
description: |-
Set the environment for this release. E.g. "production" or "staging".
Omit to skip adding deploy to release.
required: false
sourcemaps:
description: |-
Space-separated list of paths to JavaScript source maps.
Omit to skip uploading sourcemaps.
required: false
inject:
description: |-
Injects Debug IDs into source files and source maps to ensure proper
un-minifcation of your stacktraces.
Does nothing if "sourcemaps" was not set.
default: true
required: false
dist:
description: |-
Unique identifier for the distribution, used to further segment your
release.
Usually your build number.
required: false
finalize:
description: |-
When false, omit marking the release as finalized and released.
default: true
ignore_missing:
description: |-
When the flag is set and the previous release commit was not found in
the repository, will create a release with the default commits count
instead of failing the command.
default: false
required: false
ignore_empty:
description: |-
When the flag is set, command will not fail and just exit silently if no
new commits for a given release have been found.
default: false
required: false
started_at:
description: |-
Unix timestamp of the release start date. Omit for current time.
required: false
version:
description: |-
Identifier that uniquely identifies the release.
Should match the "release" property in your Sentry SDK init call if one
was set.
Omit to auto-generate one.
deprecationMessage: |-
Deprecated: Use "release" instead.
required: false
release:
description: |-
Identifier that uniquely identifies the release.
Should match the "release" property in your Sentry SDK init call if one
was set.
Omit to auto-generate one.
required: false
version_prefix:
description: |-
Value prepended to auto-generated version.
deprecationMessage: |-
Deprecated: Use "release_prefix" instead.
required: false
release_prefix:
description: |-
Value prepended to auto-generated release version.
required: false
set_commits:
description: |-
Specify whether to set commits for the release.
One of: "auto", "skip"
required: false
projects:
description: |-
Space-separated list of projects.
Defaults to the env variable "SENTRY_PROJECT" if not provided.
required: false
url_prefix:
description: |-
Adds a prefix to source map urls after stripping them.
required: false
strip_common_prefix:
description: |-
Will remove a common prefix from uploaded filenames. Useful for removing
a path that is build-machine-specific.
Note: Will not remove common prefixes across two or more directories
provided to "sourcemap". E.g. Setting
"sourcemap": "./dist/js ./dist/asset/js" will strip "./dist" for the first
directory and "./dist/assets/js" for the
default: false
required: false
working_directory:
description: |-
Directory to collect sentry release information from.
Useful when collecting information from a non-standard checkout directory.
required: false
disable_telemetry:
description: |-
The action sends telemetry data and crash reports to Sentry. This helps
us improve the action.
You can turn this off by setting this flag.
default: false
required: false
disable_safe_directory:
description: |-
The action needs access to the repo it runs in. For that we need to
configure git to mark the repo directory a safe directory.
You can turn this off by setting this flag.
default: false
required: false
runs:
using: 'composite'
steps:
# For actions running on a linux runner, we use a docker
# approach as it's faster and encapsulates everything needed
# to run the action.
- name: Run docker image
if: runner.os != 'macOS' && runner.os != 'Windows'
env:
# Composite actions don't pass the outer action's inputs
# down into these steps, so we have to replicate all inputs to be accessible
# via @actions/core here and in the `Run Release Action` step further down.
INPUT_ENVIRONMENT: ${{ inputs.environment }}
INPUT_INJECT: ${{ inputs.inject }}
INPUT_SOURCEMAPS: ${{ inputs.sourcemaps }}
INPUT_DIST: ${{ inputs.dist }}
INPUT_FINALIZE: ${{ inputs.finalize }}
INPUT_IGNORE_MISSING: ${{ inputs.ignore_missing }}
INPUT_IGNORE_EMPTY: ${{ inputs.ignore_empty }}
INPUT_STARTED_AT: ${{ inputs.started_at }}
INPUT_VERSION: ${{ inputs.version }}
INPUT_RELEASE: ${{ inputs.release }}
INPUT_VERSION_PREFIX: ${{ inputs.version_prefix }}
INPUT_RELEASE_PREFIX: ${{ inputs.release_prefix }}
INPUT_SET_COMMITS: ${{ inputs.set_commits }}
INPUT_PROJECTS: ${{ inputs.projects }}
INPUT_URL_PREFIX: ${{ inputs.url_prefix }}
INPUT_STRIP_COMMON_PREFIX: ${{ inputs.strip_common_prefix }}
INPUT_WORKING_DIRECTORY: ${{ inputs.working_directory }}
INPUT_DISABLE_TELEMETRY: ${{ inputs.disable_telemetry }}
INPUT_DISABLE_SAFE_DIRECTORY: ${{ inputs.disable_safe_directory }}
uses: docker://ghcr.io/getsentry/action-release-image:master
# For actions running on macos or windows runners, we use a composite
# action approach which allows us to install the arch specific sentry-cli
# binary that's needed for the runner.
# This is slower than the docker approach but runs on macos and windows.
- name: Mark GitHub workspace a safe directory in git
if: ${{ (runner.os == 'macOS' || runner.os == 'Windows') && inputs.disable_safe_directory != 'true' }}
shell: bash
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Setup node
if: runner.os == 'macOS' || runner.os == 'Windows'
uses: actions/setup-node@v4
with:
# setup-node doesn't allow absolute paths, so we can't
# just use `github.action_path` to read this out from the `package.json`
# any changes to the runtime need to be reflected here
node-version: 18.17.0
- name: Install Sentry CLI v2
if: runner.os == 'macOS' || runner.os == 'Windows'
shell: bash
run: npm install --no-package-lock @sentry/cli@^2.4
working-directory: ${{ github.action_path }}
- name: Run Release Action
if: runner.os == 'macOS' || runner.os == 'Windows'
env:
# Composite actions don't pass the outer action's inputs
# down into these steps, so we have to replicate all inputs to be accessible
# via @actions/core
INPUT_ENVIRONMENT: ${{ inputs.environment }}
INPUT_INJECT: ${{ inputs.inject }}
INPUT_SOURCEMAPS: ${{ inputs.sourcemaps }}
INPUT_DIST: ${{ inputs.dist }}
INPUT_FINALIZE: ${{ inputs.finalize }}
INPUT_IGNORE_MISSING: ${{ inputs.ignore_missing }}
INPUT_IGNORE_EMPTY: ${{ inputs.ignore_empty }}
INPUT_STARTED_AT: ${{ inputs.started_at }}
INPUT_VERSION: ${{ inputs.version }}
INPUT_RELEASE: ${{ inputs.release }}
INPUT_VERSION_PREFIX: ${{ inputs.version_prefix }}
INPUT_RELEASE_PREFIX: ${{ inputs.release_prefix }}
INPUT_SET_COMMITS: ${{ inputs.set_commits }}
INPUT_PROJECTS: ${{ inputs.projects }}
INPUT_URL_PREFIX: ${{ inputs.url_prefix }}
INPUT_STRIP_COMMON_PREFIX: ${{ inputs.strip_common_prefix }}
INPUT_WORKING_DIRECTORY: ${{ inputs.working_directory }}
INPUT_DISABLE_TELEMETRY: ${{ inputs.disable_telemetry }}
INPUT_DISABLE_SAFE_DIRECTORY: ${{ inputs.disable_safe_directory }}
shell: bash
run: npm run start
working-directory: ${{ github.action_path }}
branding:
icon: 'triangle'
color: 'purple'