-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrelease.config.js
46 lines (44 loc) · 1.3 KB
/
release.config.js
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
module.exports = {
verifyConditions: [
() => {
if (!process.env.NUGET_TOKEN) {
throw new SemanticReleaseError(
'The environment variable NUGET_TOKEN is required.',
'ENOAPMTOKEN',
)
}
},
'@semantic-release/changelog',
'@semantic-release/git',
'@semantic-release/github',
],
prepare: ['@semantic-release/changelog', '@semantic-release/git'],
publish: [
{
path: '@semantic-release/exec',
cmd: `dotnet nuget push .\\artifacts\\*.nupkg -k ${
process.env.NUGET_TOKEN
} -s https://api.nuget.org/v3/index.json`,
},
{
path: '@semantic-release/github',
assets: 'artifacts/**/*.nupkg',
},
],
}
/*
HACK: We should really be importing the semantic-release error package as below:
const SemanticReleaseError = require('@semantic-release/error');
and using that, however the import was failing when running semantic-release using npx
even when adding the @semantic-release/error package to npx.
Resorting to copying the source into this file instead
*/
class SemanticReleaseError extends Error {
constructor(message, code) {
super(message)
Error.captureStackTrace(this, this.constructor)
this.name = 'SemanticReleaseError'
this.code = code
this.semanticRelease = true
}
}