Skip to content

Commit

Permalink
chore: automate upgrading Node.js on cdktf-provider-project (#337)
Browse files Browse the repository at this point in the history
This uses the same script that's already been tested & proven to work
well on hashicorp/cdktf-aws-cdk. Note that this only upgrades Node on
the provider-project itself because the Node version used by the
individual provider repos is managed by cdktf-repository-manager
instead.

Also adds the automerge and auto-approve workflows we've been using
elsewhere. We don't _have_ to start using them, but this way these
automations are there if/when we need them.

---------

Signed-off-by: team-tf-cdk <[email protected]>
Co-authored-by: team-tf-cdk <[email protected]>
  • Loading branch information
xiehan and team-tf-cdk authored Oct 13, 2023
1 parent cfe6e5e commit e409883
Show file tree
Hide file tree
Showing 19 changed files with 537 additions and 27 deletions.
3 changes: 3 additions & 0 deletions .gitattributes

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

33 changes: 33 additions & 0 deletions .github/workflows/auto-approve.yml

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

25 changes: 25 additions & 0 deletions .github/workflows/automerge.yml

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

12 changes: 6 additions & 6 deletions .github/workflows/build.yml

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

2 changes: 1 addition & 1 deletion .github/workflows/lock.yml

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

2 changes: 1 addition & 1 deletion .github/workflows/pull-request-lint.yml

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

10 changes: 5 additions & 5 deletions .github/workflows/release.yml

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

10 changes: 5 additions & 5 deletions .github/workflows/upgrade-main.yml

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

67 changes: 67 additions & 0 deletions .github/workflows/upgrade-node.yml

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

3 changes: 3 additions & 0 deletions .gitignore

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

4 changes: 4 additions & 0 deletions .projen/deps.json

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

3 changes: 3 additions & 0 deletions .projen/files.json

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

27 changes: 19 additions & 8 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,38 @@

import { cdk } from "projen";
import { UpgradeDependenciesSchedule } from "projen/lib/javascript";
import { AutoApprove } from "./projenrc/auto-approve";
import { Automerge } from "./projenrc/automerge";
import { UpgradeNode } from "./projenrc/upgrade-node";
import { CustomizedLicense } from "./src/customized-license";
import { LockIssues } from "./src/lock-issues";

const githubActionPinnedVersions = {
"actions/checkout": "8e5e7e5ab8b370d6c329ec480221332ada57f0ab", // v3.5.2
"actions/setup-node": "64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c", // v3.6.0
"actions/upload-artifact": "0b7f8abb1508181956e8e162db84b466c27e18ce", // v3.1.2
"actions/checkout": "8ade135a41bc03ea155e62e844d188df1ea18608", // v4.1.0
"actions/download-artifact": "9bc31d5ccc31df68ecc42ccf4149144866c47d8a", // v3.0.2
"dessant/lock-threads": "c1b35aecc5cdb1a34539d14196df55838bb2f836", // v4.0.0
"actions/github-script": "d7906e4ad0b1822421a7e6a35d5ca353c962f410", // v6.4.1
"actions/setup-node": "5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d", // v3.8.1
"actions/upload-artifact": "a8a3f3ad30e3422c9c7b888a15615d19a852ae32", // v3.1.3
"amannn/action-semantic-pull-request":
"c3cd5d1ea3580753008872425915e343e351ab54", // v5.2.0
"peter-evans/create-pull-request": "284f54f989303d2699d373481a0cfa13ad5a6666", // v5.0.1
"47b15d52c5c30e94a17ec87eb8dd51ff5221fed9", // v5.3.0
"dessant/lock-threads": "be8aa5be94131386884a6da4189effda9b14aa21", // v4.0.1
"peter-evans/create-pull-request": "153407881ec5c347639a548ade7d8ad1d6740e38", // v5.0.2
};

const project = new cdk.JsiiProject({
name: "@cdktf/provider-project",
author: "HashiCorp",
authorAddress: "https://hashicorp.com",
repositoryUrl: "https://github.com/hashicorp/cdktf-provider-project.git",
repositoryUrl: "https://github.com/cdktf/cdktf-provider-project.git",
authorOrganization: true,
licensed: false, // we do supply our own license file with a custom header
peerDeps: ["projen@^0.71.46"],
deps: ["change-case", "fs-extra"],
devDeps: ["@types/fs-extra", "glob"],
devDeps: [
"@types/fs-extra",
"glob",
"node-fetch", // @TODO this can be removed once we upgrade to Node 18 and use native fetch
],
bundledDeps: ["change-case", "fs-extra"],
license: "MPL-2.0",
defaultReleaseBranch: "main",
Expand Down Expand Up @@ -56,6 +64,9 @@ project.addFields({ publishConfig: { access: "public" } });

new CustomizedLicense(project, 2020);
new LockIssues(project);
new AutoApprove(project);
new Automerge(project);
new UpgradeNode(project);

// Run copywrite tool to add copyright headers to all files
// This is for this repository itself, not for the projects
Expand Down
Loading

0 comments on commit e409883

Please sign in to comment.