Skip to content

Commit

Permalink
chore: upgrade cloud-assembly-schema major version
Browse files Browse the repository at this point in the history
Recently the `@aws-cdk/cloud-assembly-schema` changed their versioning
scheme to do a major version bump every time the schema is updated.

This PR updates our dependency upgrade workflow to always update
`@aws-cdk/cloud-assembly-schema` to the newest version

fixes #74
  • Loading branch information
corymhall committed Aug 26, 2024
1 parent d28e392 commit c1cfcc4
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 36 deletions.
31 changes: 28 additions & 3 deletions .projen/tasks.json

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

17 changes: 17 additions & 0 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const project = new GitHubActionTypeScriptProject({
name: 'cdk-diff-action',
projenrcTs: true,
depsUpgradeOptions: {
exclude: ['@aws-cdk/cloud-assembly-schema'],
workflowOptions: {
labels: ['auto-approve'],
schedule: UpgradeDependenciesSchedule.WEEKLY,
Expand Down Expand Up @@ -97,6 +98,22 @@ const project = new GitHubActionTypeScriptProject({


const projenProject = project as unknown as typescript.TypeScriptProject;

// There doesn't seem to be a way to specify --target for individual dependencies so
// adding a separate task to handle always doing a major upgrade to `@aws-cdk/cloud-assembly-schema`
// @see https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/cloud-assembly-schema/README.md#versioning
project.upgradeWorkflow?.postUpgradeTask.prependSpawn(projenProject.addTask('upgrade-cloud-assembly-schema', {
env: {
CI: '0',
},
steps: [
{ exec: 'npx npm-check-updates@16 --upgrade --target=latest --peer --dep=prod --filter=@aws-cdk/cloud-assembly-schema' },
{ exec: 'yarn install --check-files' },
{ exec: 'yarn upgrade @aws-cdk/cloud-assembly-schema' },
{ exec: 'npx projen' },
],
}));

const jestConfig = projenProject.tryFindObjectFile('jest.config.json');
jestConfig?.patch(JsonPatch.remove('/preset'));
jestConfig?.patch(JsonPatch.remove('/globals'));
Expand Down
7 changes: 4 additions & 3 deletions package.json

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

73 changes: 43 additions & 30 deletions yarn.lock

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

0 comments on commit c1cfcc4

Please sign in to comment.