|
8 | 8 |
|
9 | 9 | import { InternalOptions } from "../options-mapping"; |
10 | 10 | import { BuildContext } from "../types"; |
11 | | -import { createRelease, deleteAllReleaseArtifacts, updateRelease } from "./api"; |
| 11 | +import { createRelease, deleteAllReleaseArtifacts } from "./api"; |
12 | 12 | import { addSpanToTransaction } from "./telemetry"; |
13 | 13 |
|
14 | 14 | export async function createNewRelease( |
@@ -75,34 +75,15 @@ export async function uploadSourceMaps(options: InternalOptions, ctx: BuildConte |
75 | 75 | span?.finish(); |
76 | 76 | } |
77 | 77 |
|
78 | | -export async function finalizeRelease( |
79 | | - options: InternalOptions, |
80 | | - ctx: BuildContext |
81 | | -): Promise<string> { |
| 78 | +export async function finalizeRelease(options: InternalOptions, ctx: BuildContext): Promise<void> { |
82 | 79 | const span = addSpanToTransaction(ctx, "function.plugin.finalize_release"); |
83 | 80 |
|
84 | 81 | if (options.finalize) { |
85 | | - const { authToken, org, url, project } = options; |
86 | | - if (!authToken || !org || !url || !project) { |
87 | | - ctx.logger.warn("Missing required option. Will not clean existing artifacts."); |
88 | | - return Promise.resolve("nothing to do here"); |
89 | | - } |
90 | | - |
91 | | - await updateRelease({ |
92 | | - authToken, |
93 | | - org, |
94 | | - release: options.release, |
95 | | - sentryUrl: url, |
96 | | - project, |
97 | | - sentryHub: ctx.hub, |
98 | | - customHeader: options.customHeader, |
99 | | - }); |
100 | | - |
| 82 | + await ctx.cli.releases.finalize(options.release); |
101 | 83 | ctx.logger.info("Successfully finalized release."); |
102 | 84 | } |
103 | 85 |
|
104 | 86 | span?.finish(); |
105 | | - return Promise.resolve("nothing to do here"); |
106 | 87 | } |
107 | 88 |
|
108 | 89 | export async function cleanArtifacts(options: InternalOptions, ctx: BuildContext): Promise<string> { |
|
0 commit comments