Skip to content

Commit 40b0a69

Browse files
dineshSajwanDinesh Sajwanscottschreckengaustgithub-actionskrokoko
authored
feat(dotnet): publish constructs to NuGet (#529)
* publish constructs to NuGet * namespace for NuGet package * set specific commits for action versions --------- Signed-off-by: Dinesh Sajwan <[email protected]> Signed-off-by: github-actions <[email protected]> Co-authored-by: Dinesh Sajwan <[email protected]> Co-authored-by: Scott Schreckengaust <[email protected]> Co-authored-by: github-actions <[email protected]> Co-authored-by: Alain Krok <[email protected]>
1 parent 2d3a928 commit 40b0a69

File tree

6 files changed

+93
-0
lines changed

6 files changed

+93
-0
lines changed

Diff for: .github/workflows/build.yml

+28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .github/workflows/release.yml

+34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .mergify.yml

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .projen/tasks.json

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .projenrc.ts

+12
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ const PUBLICATION_NAMESPACE = 'cdklabs';
3232
const PROJECT_NAME = 'generative-ai-cdk-constructs';
3333
const CDK_VERSION: string = '2.143.0';
3434

35+
function camelCaseIt(input: string): string {
36+
// Hypens and dashes to spaces and then CamelCase...
37+
return input.replace(/-/g, ' ').replace(/_/g, ' ').replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, function(match, _) { if (+match === 0) return ''; return match.toUpperCase(); });
38+
}
39+
3540
const project = new awscdk.AwsCdkConstructLibrary({
3641
author: 'Amazon Web Services - Prototyping and Cloud Engineering',
3742
authorAddress: 'https://aws.amazon.com',
@@ -80,6 +85,11 @@ const project = new awscdk.AwsCdkConstructLibrary({
8085
// twineRegistryUrl: '${{ secrets.TWINE_REGISTRY_URL }}',
8186
},
8287

88+
publishToNuget: {
89+
dotNetNamespace: camelCaseIt(PUBLICATION_NAMESPACE)+'.'+camelCaseIt(PROJECT_NAME),
90+
packageId: camelCaseIt(PUBLICATION_NAMESPACE)+'.'+camelCaseIt(PROJECT_NAME),
91+
},
92+
8393
codeCov: true,
8494
codeCovTokenSecret: 'CODECOV_TOKEN',
8595

@@ -138,6 +148,8 @@ project.github?.actions.set('actions/checkout@v4', 'actions/checkout@b4ffde65f46
138148
project.github?.actions.set('actions/download-artifact@v3', 'actions/download-artifact@b4aefff88e83a2676a730654e1ce3dce61880379'); // https://github.com/projen/projen/issues/3529
139149
project.github?.actions.set('actions/download-artifact@v4', 'actions/download-artifact@b4aefff88e83a2676a730654e1ce3dce61880379');
140150
project.github?.actions.set('actions/github-script@v6', 'actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410');
151+
project.github?.actions.set('actions/setup-dotnet@v3', 'actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3');
152+
project.github?.actions.set('actions/setup-dotnet@v4', 'actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3');
141153
project.github?.actions.set('actions/setup-node@v3', 'actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8'); // https://github.com/projen/projen/issues/3529
142154
project.github?.actions.set('actions/setup-node@v4', 'actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8');
143155
project.github?.actions.set('actions/setup-python@v4', 'actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d'); // https://github.com/projen/projen/issues/3529

Diff for: package.json

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)