Skip to content

Commit 237b79c

Browse files
committed
ref(core): Use Sentry CLI to create new release
1 parent 6a30140 commit 237b79c

File tree

2 files changed

+6
-70
lines changed

2 files changed

+6
-70
lines changed

packages/bundler-plugin-core/src/sentry/api.ts

Lines changed: 0 additions & 51 deletions
This file was deleted.

packages/bundler-plugin-core/src/sentry/releasePipeline.ts

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,44 +8,31 @@
88

99
import { InternalOptions } from "../options-mapping";
1010
import { BuildContext } from "../types";
11-
import { createRelease } from "./api";
1211
import { addSpanToTransaction } from "./telemetry";
1312

14-
export async function createNewRelease(
15-
options: InternalOptions,
16-
ctx: BuildContext
17-
): Promise<string> {
13+
export async function createNewRelease(options: InternalOptions, ctx: BuildContext): Promise<void> {
1814
const span = addSpanToTransaction(ctx, "function.plugin.create_release");
1915

2016
// TODO: pull these checks out of here and simplify them
2117
if (options.authToken === undefined) {
2218
ctx.logger.warn('Missing "authToken" option. Will not create release.');
23-
return Promise.resolve("nothing to do here");
19+
return;
2420
} else if (options.org === undefined) {
2521
ctx.logger.warn('Missing "org" option. Will not create release.');
26-
return Promise.resolve("nothing to do here");
22+
return;
2723
} else if (options.url === undefined) {
2824
ctx.logger.warn('Missing "url" option. Will not create release.');
29-
return Promise.resolve("nothing to do here");
25+
return;
3026
} else if (options.project === undefined) {
3127
ctx.logger.warn('Missing "project" option. Will not create release.');
32-
return Promise.resolve("nothing to do here");
28+
return;
3329
}
3430

35-
await createRelease({
36-
release: options.release,
37-
authToken: options.authToken,
38-
org: options.org,
39-
project: options.project,
40-
sentryUrl: options.url,
41-
sentryHub: ctx.hub,
42-
customHeader: options.customHeader,
43-
});
31+
await ctx.cli.releases.new(options.release);
4432

4533
ctx.logger.info("Successfully created release.");
4634

4735
span?.finish();
48-
return Promise.resolve("nothing to do here");
4936
}
5037

5138
export async function uploadSourceMaps(options: InternalOptions, ctx: BuildContext): Promise<void> {

0 commit comments

Comments
 (0)