Skip to content

Commit

Permalink
feat(dotnet): publish constructs to NuGet (#529)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
5 people authored Jun 24, 2024
1 parent 2d3a928 commit 40b0a69
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions .github/workflows/release.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .mergify.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ const PUBLICATION_NAMESPACE = 'cdklabs';
const PROJECT_NAME = 'generative-ai-cdk-constructs';
const CDK_VERSION: string = '2.143.0';

function camelCaseIt(input: string): string {
// Hypens and dashes to spaces and then CamelCase...
return input.replace(/-/g, ' ').replace(/_/g, ' ').replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, function(match, _) { if (+match === 0) return ''; return match.toUpperCase(); });
}

const project = new awscdk.AwsCdkConstructLibrary({
author: 'Amazon Web Services - Prototyping and Cloud Engineering',
authorAddress: 'https://aws.amazon.com',
Expand Down Expand Up @@ -80,6 +85,11 @@ const project = new awscdk.AwsCdkConstructLibrary({
// twineRegistryUrl: '${{ secrets.TWINE_REGISTRY_URL }}',
},

publishToNuget: {
dotNetNamespace: camelCaseIt(PUBLICATION_NAMESPACE)+'.'+camelCaseIt(PROJECT_NAME),
packageId: camelCaseIt(PUBLICATION_NAMESPACE)+'.'+camelCaseIt(PROJECT_NAME),
},

codeCov: true,
codeCovTokenSecret: 'CODECOV_TOKEN',

Expand Down Expand Up @@ -138,6 +148,8 @@ project.github?.actions.set('actions/checkout@v4', 'actions/checkout@b4ffde65f46
project.github?.actions.set('actions/download-artifact@v3', 'actions/download-artifact@b4aefff88e83a2676a730654e1ce3dce61880379'); // https://github.com/projen/projen/issues/3529
project.github?.actions.set('actions/download-artifact@v4', 'actions/download-artifact@b4aefff88e83a2676a730654e1ce3dce61880379');
project.github?.actions.set('actions/github-script@v6', 'actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410');
project.github?.actions.set('actions/setup-dotnet@v3', 'actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3');
project.github?.actions.set('actions/setup-dotnet@v4', 'actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3');
project.github?.actions.set('actions/setup-node@v3', 'actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8'); // https://github.com/projen/projen/issues/3529
project.github?.actions.set('actions/setup-node@v4', 'actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8');
project.github?.actions.set('actions/setup-python@v4', 'actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d'); // https://github.com/projen/projen/issues/3529
Expand Down
5 changes: 5 additions & 0 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 40b0a69

Please sign in to comment.