forked from cdklabs/cdk-monitoring-constructs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.projenrc.js
156 lines (140 loc) · 4.2 KB
/
.projenrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
const { awscdk, javascript, DependencyType } = require("projen");
const { workflows } = require("projen/lib/github");
const CDK_VERSION = "2.18.0";
const project = new awscdk.AwsCdkConstructLibrary({
name: "cdk-monitoring-constructs",
repositoryUrl: "https://github.com/cdklabs/cdk-monitoring-constructs",
author: "CDK Monitoring Constructs Team",
authorAddress: "monitoring-cdk-constructs@amazon.com",
keywords: ["cloudwatch", "monitoring"],
defaultReleaseBranch: "main",
majorVersion: 1,
stability: "experimental",
cdkVersion: CDK_VERSION,
srcdir: "lib",
testdir: "test",
// Artifact config: Python
publishToPypi: {
distName: "cdk-monitoring-constructs",
module: "cdk_monitoring_constructs",
},
// Artifact config: C#
publishToNuget: {
packageId: "Cdklabs.CdkMonitoringConstructs",
dotNetNamespace: "Cdklabs.CdkMonitoringConstructs",
},
// Artifact config: Java
publishToMaven: {
mavenGroupId: "io.github.cdklabs",
javaPackage: "io.github.cdklabs.cdkmonitoringconstructs",
mavenArtifactId: "cdkmonitoringconstructs",
mavenEndpoint: "https://s01.oss.sonatype.org",
},
// TODO: https://github.com/cdklabs/cdk-monitoring-constructs/issues/21
// Artifact config: Go
// publishToGo: {
// moduleName: "github.com/cdklabs/cdk-monitoring-constructs",
// },
// Auto approval config
autoApproveOptions: {
allowedUsernames: ["cdklabs-automation"],
secret: "GITHUB_TOKEN",
},
autoApproveUpgrades: true,
depsUpgradeOptions: {
workflowOptions: {
schedule: javascript.UpgradeDependenciesSchedule.expressions([
"0 0 * * 1",
]),
},
},
pullRequestTemplateContents: [
`Fixes #
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license_`,
],
// Code linting config
prettier: true,
prettierOptions: {
arrowParens: "always",
bracketSpacing: false,
printWidth: 140,
semi: true,
tabWidth: 4,
trailingComma: "all",
},
});
// Experimental modules
[
"@aws-cdk/aws-apigatewayv2-alpha",
"@aws-cdk/aws-appsync-alpha",
"@aws-cdk/aws-redshift-alpha",
"@aws-cdk/aws-synthetics-alpha",
].forEach((dep) => {
project.deps.addDependency(
`${dep}@^${CDK_VERSION}-alpha.0`,
DependencyType.PEER
);
project.deps.addDependency(
`${dep}@${CDK_VERSION}-alpha.0`,
DependencyType.DEVENV
);
});
// https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/60310
project.deps.addDependency("@types/prettier@2.6.0", DependencyType.DEVENV);
// Add some other eslint rules followed across this project
project.eslint.addRules({
"no-case-declarations": "off",
"no-bitwise": "off",
"no-shadow": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-shadow": "off",
"@typescript-eslint/member-ordering": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"prettier/prettier": "error",
});
// Don't need to include the TypeScript source files in the tarball; the transpiled JS files and
// typing files are sufficient.
project.addPackageIgnore("*.ts");
project.addPackageIgnore("!*.d.ts");
project.release.addJobs({
notify_slack: {
name: "Send Slack notification",
runsOn: "ubuntu-latest",
permissions: {
actions: workflows.JobPermission.READ,
},
needs: [
"release",
"release_github",
"release_maven",
"release_npm",
"release_nuget",
"release_pypi",
// TODO: https://github.com/cdklabs/cdk-monitoring-constructs/issues/21
// "release_golang",
],
steps: [
{
name: "Get release",
id: "get_release",
uses: "cardinalby/git-get-release-action@v1",
env: {
GITHUB_TOKEN: "${{ github.token }}",
},
},
{
name: "Send notification",
uses: "slackapi/slack-github-action@v1.18.0",
with: {
payload: `{"html_url": "\${{ steps.get_release.outputs.html_url }}", "tag_name": "\${{ steps.get_release.outputs.tag_name }}"}`,
},
env: {
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}",
},
},
],
},
});
project.synth();