@halospv3/hce.shared-config 2.3.0 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/dotnet/dotnetHelpers.cjs +38 -38
- package/cjs/dotnet/dotnetHelpers.cjs.map +1 -1
- package/cjs/dotnet/dotnetHelpers.d.ts.map +1 -1
- package/cjs/semantic-release__github.d.cjs +2 -0
- package/cjs/semantic-release__github.d.cjs.map +1 -0
- package/cjs/semanticReleaseConfigDotnet.cjs +5 -1
- package/cjs/semanticReleaseConfigDotnet.cjs.map +1 -1
- package/cjs/semanticReleaseConfigDotnet.d.ts +5 -2
- package/cjs/semanticReleaseConfigDotnet.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/dotnet/dotnetHelpers.ts +50 -53
- package/src/semantic-release__github.d.ts +145 -0
- package/src/semanticReleaseConfigDotnet.ts +7 -2
|
@@ -26,51 +26,51 @@ function configurePrepareCmd(projectsToPublish, projectsToPackAndPush, dotnetNug
|
|
|
26
26
|
```
|
|
27
27
|
enclosing with """ is required in pwsh to prevent the semicolon from breaking the string.
|
|
28
28
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
29
|
+
if (!(Array.isArray(projectsToPublish) && projectsToPublish.length > 0)) throw new Error(`Type of projectsToPublish (${typeof projectsToPublish}) is not allowed. Expected a string[] where length > 0.`);
|
|
30
|
+
|
|
31
|
+
// each may have TargetFramework OR TargetFrameworks (plural)
|
|
32
|
+
const evaluatedProjects = projectsToPublish.map(proj => new MSBuildProject.MSBuildProject(proj, publishProperties));
|
|
33
|
+
// args appended to "dotnet publish", joined by space
|
|
34
|
+
const dotnetPublishArgs = evaluatedProjects.flatMap(proj => {
|
|
35
|
+
const args = [proj.Properties.FullPath];
|
|
36
|
+
function appendCustomProperties() {
|
|
37
|
+
// convert to dictionary and filter for user-defined properties.
|
|
38
|
+
const dictionary = Object.entries(proj.Properties).filter(p => !publishProperties.includes(p[0]));
|
|
39
|
+
if (dictionary.length > 0) {
|
|
40
|
+
/* format remaining properties as "-p:Property=Value" and append to args */
|
|
41
|
+
args.push(...dictionary.map(keyValuePair => `-p:${keyValuePair[0]}=${keyValuePair[1]}`));
|
|
43
42
|
}
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
}
|
|
44
|
+
appendCustomProperties();
|
|
45
|
+
const cmdPermutations = []; // forEach, run dotnet [...args,...v]
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
} else {
|
|
58
|
-
// assume singular TFM. No need to specify it.
|
|
59
|
-
for (const RID of RIDs) {
|
|
60
|
-
cmdPermutations.push(['--runtime', RID]);
|
|
47
|
+
function formatFrameworksAndRuntimes() {
|
|
48
|
+
const RIDs = proj.Properties.RuntimeIdentifiers.length > 0 ? proj.Properties.RuntimeIdentifiers.split(';') : [];
|
|
49
|
+
const TFMs = proj.Properties.TargetFrameworks.length > 0 ? proj.Properties.TargetFrameworks.split(';') : [];
|
|
50
|
+
if (RIDs.length > 0) {
|
|
51
|
+
if (TFMs.length > 0) {
|
|
52
|
+
for (const RID of RIDs) {
|
|
53
|
+
for (const TFM of TFMs) {
|
|
54
|
+
cmdPermutations.push(['--runtime', RID, '--framework', TFM]);
|
|
61
55
|
}
|
|
62
56
|
}
|
|
63
|
-
} else
|
|
64
|
-
|
|
65
|
-
|
|
57
|
+
} else {
|
|
58
|
+
// assume singular TFM. No need to specify it.
|
|
59
|
+
for (const RID of RIDs) {
|
|
60
|
+
cmdPermutations.push(['--runtime', RID]);
|
|
66
61
|
}
|
|
67
62
|
}
|
|
63
|
+
} else if (TFMs.length > 0) {
|
|
64
|
+
for (const TFM of TFMs) {
|
|
65
|
+
cmdPermutations.push(['--framework', TFM]);
|
|
66
|
+
}
|
|
68
67
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
68
|
+
}
|
|
69
|
+
formatFrameworksAndRuntimes();
|
|
70
|
+
return cmdPermutations.length > 0 ? cmdPermutations.map(permArgs => [...args, ...permArgs]) // string[][]
|
|
71
|
+
: [args]; // string[][]
|
|
72
|
+
}); // string[][][] -> string[][]
|
|
73
|
+
|
|
74
74
|
return dotnetPublishArgs.map(args => `dotnet publish ${args.join(' ')}`).join(' && ');
|
|
75
75
|
}
|
|
76
76
|
function formatDotnetPack() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dotnetHelpers.cjs","sources":["../../src/dotnet/dotnetHelpers.ts"],"sourcesContent":null,"names":["MSBuildProjectPreDefinedProperties","MSBuildProject","nugetGitHubUrlBase","getGithubNugetRegistryPair","getGitlabNugetRegistryPair","ok"],"mappings":";;;;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,iBAAiB,EAAE,qBAAqB,EAAE,mBAAmB,GAAG,CAAC,WAAW,CAAC,EAAE;AACnH;AACA,EAAE,MAAM,iBAAiB,GAAGA,iDAAkC,CAAC;AAC/D,EAAE,SAAS,mBAAmB,GAAG;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"dotnetHelpers.cjs","sources":["../../src/dotnet/dotnetHelpers.ts"],"sourcesContent":null,"names":["MSBuildProjectPreDefinedProperties","MSBuildProject","nugetGitHubUrlBase","getGithubNugetRegistryPair","getGitlabNugetRegistryPair","ok"],"mappings":";;;;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,iBAAiB,EAAE,qBAA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,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAClB;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dotnetHelpers.d.ts","sourceRoot":"","sources":["../../src/dotnet/dotnetHelpers.ts"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAClC,iBAAiB,EAAE,MAAM,EAAE,EAC3B,qBAAqB,EAAE,MAAM,EAAE,EAC/B,mBAAmB,GAAE,MAAM,EAAkB,
|
|
1
|
+
{"version":3,"file":"dotnetHelpers.d.ts","sourceRoot":"","sources":["../../src/dotnet/dotnetHelpers.ts"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAClC,iBAAiB,EAAE,MAAM,EAAE,EAC3B,qBAAqB,EAAE,MAAM,EAAE,EAC/B,mBAAmB,GAAE,MAAM,EAAkB,UA8G7C;AAED,MAAM,WAAW,iBAAiB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B;AACD,eAAO,MAAM,YAAY,EAAE,iBAG1B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAC7C,QAAQ,SAAc,EACtB,UAAU,GAAE,iBAAiB,EAAmB,EAChD,YAAY,UAAO,mBA4BnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semantic-release__github.d.cjs","sources":[],"sourcesContent":null,"names":[],"mappings":";;"}
|
|
@@ -55,7 +55,10 @@ function appendPlugins(config, projectsToPublish, projectsToPackAndPush) {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
|
-
* @
|
|
58
|
+
* Configures {@link baseConfig} with `@semantic-release/exec` to `dotnet` publish, pack, and push.
|
|
59
|
+
* @param projectsToPublish
|
|
60
|
+
* @param projectsToPackAndPush
|
|
61
|
+
* @returns a semantic-release Options object, based on @halospv3/hce.shared-config (our base config), with the `@semantic-release/exec` plugin configured to `dotnet` publish, pack, and push the provided projects.
|
|
59
62
|
*/
|
|
60
63
|
function getConfig(projectsToPublish, projectsToPackAndPush) {
|
|
61
64
|
if (process.argv.includes('--debug') || process.argv.includes('--verbose')) {
|
|
@@ -67,6 +70,7 @@ function getConfig(projectsToPublish, projectsToPackAndPush) {
|
|
|
67
70
|
if (process.argv.includes('--debug') || process.argv.includes('--verbose')) {
|
|
68
71
|
node_console.log(`modified plugins array:\n${JSON.stringify(newConfig.plugins, null, 2)}`);
|
|
69
72
|
}
|
|
73
|
+
return newConfig;
|
|
70
74
|
}
|
|
71
75
|
exports.appendPlugins = appendPlugins;
|
|
72
76
|
exports.getConfig = getConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semanticReleaseConfigDotnet.cjs","sources":["../src/semanticReleaseConfigDotnet.ts"],"sourcesContent":null,"names":["defaultPlugins","setupGitPluginSpec","configurePrepareCmd","configureDotnetNugetPush","log","baseConfig"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB,CAAC,MAAM,EAAE;AAC7C,EAAE,MAAM,SAAS,GAAG,MAAM,CAAC;AAC3B;AACA,EAAE,SAAS,CAAC,OAAO,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,IAAIA,oCAAc,EAAE,CAAC;AAC9D,EAAE,SAAS,CAAC,OAAO,GAAGC,qCAAkB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAC5D,EAAE,OAAO,SAAS,CAAC;AACnB,CAAC;AACM,SAAS,aAAa,CAAC,MAAM,EAAE,iBAAiB,EAAE,qBAAqB,EAAE;AAChF,EAAE,MAAM,SAAS,GAAG,MAAM,CAAC;AAC3B,EAAE,IAAI,SAAS,CAAC,OAAO,K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.cjs","sources":["../src/semanticReleaseConfigDotnet.ts"],"sourcesContent":null,"names":["defaultPlugins","setupGitPluginSpec","configurePrepareCmd","configureDotnetNugetPush","log","baseConfig"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB,CAAC,MAAM,EAAE;AAC7C,EAAE,MAAM,SAAS,GAAG,MAAM,CAAC;AAC3B;AACA,EAAE,SAAS,CAAC,OAAO,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,IAAIA,oCAAc,EAAE,CAAC;AAC9D,EAAE,SAAS,CAAC,OAAO,GAAGC,qCAAkB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAC5D,EAAE,OAAO,SAAS,CAAC;AACnB,CAAC;AACM,SAAS,aAAa,CAAC,MAAM,EAAE,iBAAiB,EAAE,qBAAqB,EAAE;AAChF,EAAE,MAAM,SAAS,GAAG,MAAM,CAAC;AAC3B,EAAE,IAAI,SAAS,CAAC,OAAO,KAAK,SAAS,EAAE,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;AAClH,EAAE,SAAS,CAAC,OAAO,CAAC,IAAI;AACxB;AACA;AACA,EAAE,CAAC,wBAAwB,EAAE;AAC7B;AACA,IAAI,UAAU,EAAEC,iCAAmB,CAAC,iBAAiB,EAAE,qBAAqB,CAAC;AAC7E,IAAI,UAAU,EAAEC,sCAAwB,EAAE;AAC1C,GAAG,CAAC,CAAC,CAAC;AACN,EAAE,OAAO,SAAS,CAAC;AACnB,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,iBAAiB,EAAE,qBAAqB,EAAE;AACpE,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;AAC9E,IAAIC,gBAAG,CAAC,CAAC,oBAAoB,EAAE,IAAI,CAAC,SAAS,CAACC,gCAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtE,GAAG;AACH,EAAE,IAAI,SAAS,GAAG;AAClB,IAAI,GAAGA,gCAAU;AACjB,GAAG,CAAC;AACJ,EAAE,SAAS,GAAG,oBAAoB,CAAC,SAAS,CAAC,CAAC;AAC9C,EAAE,SAAS,GAAG,aAAa,CAAC,SAAS,EAAE,iBAAiB,EAAE,qBAAqB,CAAC,CAAC;AACjF,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;AAC9E,IAAID,gBAAG,CAAC,CAAC,yBAAyB,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClF,GAAG;AACH,EAAE,OAAO,SAAS,CAAC;AACnB;;;;;;"}
|
|
@@ -24,7 +24,10 @@ import type { Options } from 'semantic-release';
|
|
|
24
24
|
export declare function insertAndEditPlugins(config: Options): Options;
|
|
25
25
|
export declare function appendPlugins(config: Options, projectsToPublish: string[], projectsToPackAndPush: string[]): Options;
|
|
26
26
|
/**
|
|
27
|
-
* @
|
|
27
|
+
* Configures {@link baseConfig} with `@semantic-release/exec` to `dotnet` publish, pack, and push.
|
|
28
|
+
* @param projectsToPublish
|
|
29
|
+
* @param projectsToPackAndPush
|
|
30
|
+
* @returns a semantic-release Options object, based on @halospv3/hce.shared-config (our base config), with the `@semantic-release/exec` plugin configured to `dotnet` publish, pack, and push the provided projects.
|
|
28
31
|
*/
|
|
29
|
-
export declare function getConfig(projectsToPublish: string[], projectsToPackAndPush: string[]):
|
|
32
|
+
export declare function getConfig(projectsToPublish: string[], projectsToPackAndPush: string[]): Options;
|
|
30
33
|
//# sourceMappingURL=semanticReleaseConfigDotnet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semanticReleaseConfigDotnet.d.ts","sourceRoot":"","sources":["../src/semanticReleaseConfigDotnet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAc,MAAM,kBAAkB,CAAC;AAK5D;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAQ7D;AAED,wBAAgB,aAAa,CAC5B,MAAM,EAAE,OAAO,EACf,iBAAiB,EAAE,MAAM,EAAE,EAC3B,qBAAqB,EAAE,MAAM,EAAE,WAkB/B;AAED
|
|
1
|
+
{"version":3,"file":"semanticReleaseConfigDotnet.d.ts","sourceRoot":"","sources":["../src/semanticReleaseConfigDotnet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAc,MAAM,kBAAkB,CAAC;AAK5D;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAQ7D;AAED,wBAAgB,aAAa,CAC5B,MAAM,EAAE,OAAO,EACf,iBAAiB,EAAE,MAAM,EAAE,EAC3B,qBAAqB,EAAE,MAAM,EAAE,WAkB/B;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,iBAAiB,EAAE,MAAM,EAAE,EAAE,qBAAqB,EAAE,MAAM,EAAE,GAAG,OAAO,CAc/F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@halospv3/hce.shared-config",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"description": "Automate commit message quality, changelogs, and CI/CD releases. Exports a semantic-release shareable configuration deserialized from this package's '.releaserc.yml'. Shared resources for .NET projects are also distributed with this package.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"halo",
|
|
@@ -29,70 +29,67 @@ export function configurePrepareCmd(
|
|
|
29
29
|
```
|
|
30
30
|
enclosing with """ is required in pwsh to prevent the semicolon from breaking the string.
|
|
31
31
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// each may have TargetFramework OR TargetFrameworks (plural)
|
|
35
|
-
const evaluatedProjects: MSBuildProject[] = projectsToPublish.map(
|
|
36
|
-
(proj) => new MSBuildProject(proj, publishProperties),
|
|
37
|
-
);
|
|
38
|
-
// args appended to "dotnet publish", joined by space
|
|
39
|
-
dotnetPublishArgs = evaluatedProjects.flatMap((proj) => {
|
|
40
|
-
const args: string[] = [proj.Properties.FullPath];
|
|
32
|
+
if (!(Array.isArray(projectsToPublish) && projectsToPublish.length > 0))
|
|
33
|
+
throw new Error(`Type of projectsToPublish (${typeof projectsToPublish}) is not allowed. Expected a string[] where length > 0.`);
|
|
41
34
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
// each may have TargetFramework OR TargetFrameworks (plural)
|
|
36
|
+
const evaluatedProjects: MSBuildProject[] = projectsToPublish.map(
|
|
37
|
+
(proj) => new MSBuildProject(proj, publishProperties),
|
|
38
|
+
);
|
|
39
|
+
// args appended to "dotnet publish", joined by space
|
|
40
|
+
const dotnetPublishArgs = evaluatedProjects.flatMap((proj) => {
|
|
41
|
+
const args: string[] = [proj.Properties.FullPath];
|
|
42
|
+
|
|
43
|
+
function appendCustomProperties() {
|
|
44
|
+
// convert to dictionary and filter for user-defined properties.
|
|
45
|
+
const dictionary = Object.entries(proj.Properties).filter(
|
|
46
|
+
(p) => !publishProperties.includes(p[0]),
|
|
47
|
+
);
|
|
48
|
+
if (dictionary.length > 0) {
|
|
49
|
+
/* format remaining properties as "-p:Property=Value" and append to args */
|
|
50
|
+
args.push(
|
|
51
|
+
...dictionary.map((keyValuePair) => `-p:${keyValuePair[0]}=${keyValuePair[1]}`),
|
|
46
52
|
);
|
|
47
|
-
if (dictionary.length > 0) {
|
|
48
|
-
/* format remaining properties as "-p:Property=Value" and append to args */
|
|
49
|
-
args.push(
|
|
50
|
-
...dictionary.map((keyValuePair) => `-p:${keyValuePair[0]}=${keyValuePair[1]}`),
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
53
|
}
|
|
54
|
-
|
|
54
|
+
}
|
|
55
|
+
appendCustomProperties();
|
|
55
56
|
|
|
56
|
-
|
|
57
|
+
const cmdPermutations: string[][] = []; // forEach, run dotnet [...args,...v]
|
|
57
58
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
} else {
|
|
75
|
-
// assume singular TFM. No need to specify it.
|
|
76
|
-
for (const RID of RIDs) {
|
|
77
|
-
cmdPermutations.push(['--runtime', RID]);
|
|
59
|
+
function formatFrameworksAndRuntimes() {
|
|
60
|
+
const RIDs: string[] =
|
|
61
|
+
proj.Properties.RuntimeIdentifiers.length > 0
|
|
62
|
+
? proj.Properties.RuntimeIdentifiers.split(';')
|
|
63
|
+
: [];
|
|
64
|
+
const TFMs: string[] =
|
|
65
|
+
proj.Properties.TargetFrameworks.length > 0
|
|
66
|
+
? proj.Properties.TargetFrameworks.split(';')
|
|
67
|
+
: [];
|
|
68
|
+
if (RIDs.length > 0) {
|
|
69
|
+
if (TFMs.length > 0) {
|
|
70
|
+
for (const RID of RIDs) {
|
|
71
|
+
for (const TFM of TFMs) {
|
|
72
|
+
cmdPermutations.push(['--runtime', RID, '--framework', TFM]);
|
|
78
73
|
}
|
|
79
74
|
}
|
|
80
|
-
} else
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
} else {
|
|
76
|
+
// assume singular TFM. No need to specify it.
|
|
77
|
+
for (const RID of RIDs) {
|
|
78
|
+
cmdPermutations.push(['--runtime', RID]);
|
|
83
79
|
}
|
|
84
80
|
}
|
|
81
|
+
} else if (TFMs.length > 0) {
|
|
82
|
+
for (const TFM of TFMs) {
|
|
83
|
+
cmdPermutations.push(['--framework', TFM]);
|
|
84
|
+
}
|
|
85
85
|
}
|
|
86
|
-
|
|
86
|
+
}
|
|
87
|
+
formatFrameworksAndRuntimes();
|
|
87
88
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
} else
|
|
93
|
-
throw new Error(
|
|
94
|
-
`Type of projectsToPublish (${typeof projectsToPublish}) is not allowed. Expected a string[] where length > 0.`,
|
|
95
|
-
);
|
|
89
|
+
return cmdPermutations.length > 0
|
|
90
|
+
? cmdPermutations.map((permArgs) => [...args, ...permArgs]) // string[][]
|
|
91
|
+
: [args]; // string[][]
|
|
92
|
+
}); // string[][][] -> string[][]
|
|
96
93
|
|
|
97
94
|
return dotnetPublishArgs.map((args) => `dotnet publish ${args.join(' ')}`).join(' && ');
|
|
98
95
|
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
declare module "@semantic-release/github" {
|
|
2
|
+
/**
|
|
3
|
+
* @see https://github.com/semantic-release/github#configuration
|
|
4
|
+
*/
|
|
5
|
+
export interface Env extends NodeJS.ProcessEnv {
|
|
6
|
+
/**
|
|
7
|
+
* __Required__. The token used to authenticate with GitHub.
|
|
8
|
+
*/
|
|
9
|
+
GITHUB_TOKEN?: string,
|
|
10
|
+
/**
|
|
11
|
+
* {@inheritDoc GitHubEnv.GITHUB_TOKEN}
|
|
12
|
+
*/
|
|
13
|
+
GH_TOKEN?: string,
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The GitHub server endpoint.
|
|
17
|
+
*/
|
|
18
|
+
GITHUB_URL?: string,
|
|
19
|
+
/**
|
|
20
|
+
* {@inheritDoc GitHubEnv.GITHUB_URL}
|
|
21
|
+
*/
|
|
22
|
+
GH_URL?: string,
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The GitHub API prefix, relative to {@link Env.GITHUB_URL GITHUB_URL}.
|
|
26
|
+
*/
|
|
27
|
+
GITHUB_PREFIX?: string,
|
|
28
|
+
/** {@inheritDoc GitHubEnv.GITHUB_PREFIX} */
|
|
29
|
+
GH_PREFIX?: string,
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The GitHub API endpoint. Note that this overwrites {@link Env.GITHUB_PREFIX GITHUB_PREFIX}.
|
|
33
|
+
*/
|
|
34
|
+
GITHUB_API_URL?: string
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** https://github.com/isaacs/node-glob#glob-primer */
|
|
38
|
+
type Glob = string;
|
|
39
|
+
|
|
40
|
+
/** @see https://github.com/semantic-release/github#assets */
|
|
41
|
+
interface Asset {
|
|
42
|
+
/** __Required__. A {@link https://github.com/isaacs/node-glob#glob-primer glob} to identify the files to upload. */
|
|
43
|
+
path: Glob,
|
|
44
|
+
/**
|
|
45
|
+
* The name of the downloadable file on the GitHub release.
|
|
46
|
+
* @defaultValue File name extracted from the {@link Asset.path path}.
|
|
47
|
+
*/
|
|
48
|
+
name?: string,
|
|
49
|
+
/** Short description of the file displayed on the GitHub release. */
|
|
50
|
+
label?: string
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** @see https://github.com/semantic-release/github#configuration */
|
|
54
|
+
export interface Options {
|
|
55
|
+
/**
|
|
56
|
+
* The GitHub server endpoint.
|
|
57
|
+
* @defaultValue {@link Env.GH_URL GH_URL} or {@link Env.GITHUB_URL GITHUB_URL} environment variables.
|
|
58
|
+
*/
|
|
59
|
+
githubUrl?: string,
|
|
60
|
+
/**
|
|
61
|
+
* The GitHub API prefix, relative to `githubUrl`.
|
|
62
|
+
* @defaultValue {@link Env.GH_PREFIX GH_PREFIX} or {@link Env.GITHUB_PREFIX GITHUB_PREFIX} environment variables
|
|
63
|
+
*/
|
|
64
|
+
githubApiPathPrefix?: string,
|
|
65
|
+
/**
|
|
66
|
+
* The GitHub API endpoint.
|
|
67
|
+
* Note that this overwrites {@link Options.githubApiPathPrefix githubApiPathPrefix}.
|
|
68
|
+
*/
|
|
69
|
+
githubApiUrl?: string,
|
|
70
|
+
/**
|
|
71
|
+
* The proxy to use to access the GitHub API.
|
|
72
|
+
* Set to `false` to disable usage of proxy.
|
|
73
|
+
* See {@link https://github.com/semantic-release/github#proxy proxy}.
|
|
74
|
+
*/
|
|
75
|
+
proxy?: string | false,
|
|
76
|
+
/**
|
|
77
|
+
* An array of files to upload to the release.
|
|
78
|
+
* See {@link https://github.com/semantic-release/github#assets assets}.
|
|
79
|
+
*/
|
|
80
|
+
assets?: Glob | (Asset | Glob)[],
|
|
81
|
+
/**
|
|
82
|
+
* The comment to add to each issue and pull request resolved by the release.
|
|
83
|
+
* Set to `false` to disable commenting on issues and pull requests.
|
|
84
|
+
* See {@link https://github.com/semantic-release/github?tab=readme-ov-file#successcomment successComment}.
|
|
85
|
+
* @defaultValue `:tada: This issue has been resolved in version ${nextRelease.version} :tada:\n\nThe release is available on [GitHub release](<github_release_url>)`
|
|
86
|
+
*/
|
|
87
|
+
successComment?: string | false,
|
|
88
|
+
/**
|
|
89
|
+
* The content of the issue created when a release fails.
|
|
90
|
+
* Set to `false` to disable opening an issue when a release fails.
|
|
91
|
+
* See {@link https://github.com/semantic-release/github?tab=readme-ov-file#failcomment failComment}.
|
|
92
|
+
* @defaultValue Friendly message with links to semantic-release documentation and support, with the list of errors that caused the release to fail.
|
|
93
|
+
*/
|
|
94
|
+
failComment?: string | false,
|
|
95
|
+
/**
|
|
96
|
+
* The title of the issue created when a release fails.
|
|
97
|
+
* Set to `false` to disable opening an issue when a release fails.
|
|
98
|
+
* @defaultValue `The automated release is failing 🚨`
|
|
99
|
+
*/
|
|
100
|
+
failTitle?: string | false,
|
|
101
|
+
/**
|
|
102
|
+
* The {@link https://help.github.com/articles/about-labels labels} to add to the issue created when a release fails.
|
|
103
|
+
* Set to `false` to not add any label.
|
|
104
|
+
* @default ['semantic-release']
|
|
105
|
+
*/
|
|
106
|
+
labels?: string[] | false,
|
|
107
|
+
/**
|
|
108
|
+
* The {@link https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users assignees} to add to the issue created when a release fails.
|
|
109
|
+
*/
|
|
110
|
+
assignees?: unknown,
|
|
111
|
+
/**
|
|
112
|
+
* The {@link https://help.github.com/articles/about-labels labels} to add to each issue and pull request resolved by the release.
|
|
113
|
+
* Set to `false` to not add any label.
|
|
114
|
+
* See {@link https://github.com/semantic-release/github#releasedlabels releasedLabels}.
|
|
115
|
+
* @default [ 'released<%= nextRelease.channel ? \` on @\${nextRelease.channel}\` : "" %>' ]
|
|
116
|
+
*/
|
|
117
|
+
releasedLabels?: string[],
|
|
118
|
+
/**
|
|
119
|
+
* Will add release links to the GitHub Release. Can be `false`, `"bottom"` or `"top"`. See {@link https://github.com/semantic-release/github#addReleases addReleases}.
|
|
120
|
+
* @default false
|
|
121
|
+
*/
|
|
122
|
+
addReleases?: false | "bottom" | "top",
|
|
123
|
+
/**
|
|
124
|
+
* A boolean indicating if a GitHub Draft Release should be created instead of publishing an actual GitHub Release.
|
|
125
|
+
* @default false
|
|
126
|
+
*/
|
|
127
|
+
draftRelease?: boolean,
|
|
128
|
+
/**
|
|
129
|
+
* A {@link https://lodash.com/docs#template Lodash template} to customize the github release's name
|
|
130
|
+
* @default '<%= nextverison.name %>'
|
|
131
|
+
*/
|
|
132
|
+
releaseNameTemplate?: string,
|
|
133
|
+
/**
|
|
134
|
+
* A {@link https://lodash.com/docs#template Lodash template} to customize the github release's body
|
|
135
|
+
* @default '<%= nextverison.notes %>'
|
|
136
|
+
*/
|
|
137
|
+
releaseBodyTemplate?: string,
|
|
138
|
+
/**
|
|
139
|
+
* The category name in which to create a linked discussion to the release.
|
|
140
|
+
* Set to `false` to disable creating discussion for a release.
|
|
141
|
+
* @default false
|
|
142
|
+
*/
|
|
143
|
+
discussionCategoryName?: string | false
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -61,9 +61,12 @@ export function appendPlugins(
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
|
-
* @
|
|
64
|
+
* Configures {@link baseConfig} with `@semantic-release/exec` to `dotnet` publish, pack, and push.
|
|
65
|
+
* @param projectsToPublish
|
|
66
|
+
* @param projectsToPackAndPush
|
|
67
|
+
* @returns a semantic-release Options object, based on @halospv3/hce.shared-config (our base config), with the `@semantic-release/exec` plugin configured to `dotnet` publish, pack, and push the provided projects.
|
|
65
68
|
*/
|
|
66
|
-
export function getConfig(projectsToPublish: string[], projectsToPackAndPush: string[]) {
|
|
69
|
+
export function getConfig(projectsToPublish: string[], projectsToPackAndPush: string[]): Options {
|
|
67
70
|
if (process.argv.includes('--debug') || process.argv.includes('--verbose')) {
|
|
68
71
|
log(`hce.shared-config:\n${JSON.stringify(baseConfig, null, 2)}`);
|
|
69
72
|
}
|
|
@@ -75,4 +78,6 @@ export function getConfig(projectsToPublish: string[], projectsToPackAndPush: st
|
|
|
75
78
|
if (process.argv.includes('--debug') || process.argv.includes('--verbose')) {
|
|
76
79
|
log(`modified plugins array:\n${JSON.stringify(newConfig.plugins, null, 2)}`);
|
|
77
80
|
}
|
|
81
|
+
|
|
82
|
+
return newConfig;
|
|
78
83
|
}
|