Skip to content

Commit d48a8b0

Browse files
fix: Avoid global.json when running dotnet push (#601)
* fix: Avoid global.json when running `dotnet push` Resolves #598: - #598 Pinning the version of of the .NET SDK used to build the sentry-dotnet repo prevents us from making relases, since that version of .NET is not installed on the machine that publishes NuGet packages. We can run `dotnet push` using any version of .NET so this PR simply runs that command from outside the repository working directory. * Update nuget.ts
1 parent ef2d370 commit d48a8b0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/targets/nuget.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,19 @@ export class NugetTarget extends BaseTarget {
6666
* @returns A promise that resolves when the upload has completed
6767
*/
6868
public async uploadAsset(path: string): Promise<any> {
69-
return spawnProcess(NUGET_DOTNET_BIN, [
69+
const args = [
7070
'nuget',
7171
'push',
7272
path,
7373
'--api-key',
7474
'${NUGET_API_TOKEN}',
7575
'--source',
7676
this.nugetConfig.serverUrl,
77-
]);
77+
];
78+
// Run outside the repository folder to avoid global.json constraints
79+
// (we don't need specific dotnet/workload versions just to upload to nuget)
80+
const spawnOptions = { cwd: '/' };
81+
return spawnProcess(NUGET_DOTNET_BIN, args, spawnOptions);
7882
}
7983

8084
/**

0 commit comments

Comments
 (0)