-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.projenrc.ts
123 lines (118 loc) · 3.7 KB
/
.projenrc.ts
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
import { ReleasableCommits, cdk, github, javascript } from 'projen';
import { JobPermission } from 'projen/lib/github/workflows-model';
const project = new cdk.JsiiProject({
author: 'The Open Construct Foundation',
authorAddress: '[email protected]',
authorOrganization: true,
copyrightOwner: 'The Open Construct Foundation',
copyrightPeriod: '2024',
defaultReleaseBranch: 'main',
name: 'projen-pipelines',
projenrcTs: true,
packageManager: javascript.NodePackageManager.NPM,
repositoryUrl: 'https://github.com/open-constructs/projen-pipelines.git',
licensed: true,
license: 'Apache-2.0',
jsiiVersion: '~5.4',
devDeps: [
'constructs',
'fs-extra',
'@types/fs-extra',
'@types/standard-version',
],
bundledDeps: [
'standard-version',
],
peerDeps: [
'projen@>=0.86.7 <1.0.0',
'constructs@^10.4.2',
],
autoApproveUpgrades: true,
autoApproveOptions: { allowedUsernames: ['hoegertn', 'Lock128', 'open-constructs-projen[bot]'], secret: 'GITHUB_TOKEN' },
depsUpgradeOptions: { workflowOptions: { schedule: javascript.UpgradeDependenciesSchedule.WEEKLY } },
githubOptions: {
projenCredentials: github.GithubCredentials.fromApp(),
pullRequestLintOptions: {
semanticTitleOptions: {
types: ['feat', 'fix', 'chore', 'ci', 'docs', 'style', 'refactor', 'test', 'revert', 'Revert'],
},
},
},
releasableCommits: ReleasableCommits.ofType(['feat', 'fix', 'revert', 'Revert', 'docs']),
keywords: [
'aws',
'cdk',
'projen',
],
bin: {
'pipelines-release': 'lib/release.js',
},
releaseToNpm: true,
gitpod: true,
tsconfig: {
compilerOptions: {
esModuleInterop: true,
},
},
});
project.addTask('local-push', { exec: 'npx yalc push' }).prependSpawn(project.buildTask);
project.gitpod?.addCustomTask({
init: 'npm ci',
command: 'npx projen build',
});
// Integration tests for existing and new projects
const integWf = project.github?.addWorkflow('integ');
integWf?.on({
push: { branches: ['main'] },
workflowDispatch: {},
pullRequest: {},
});
integWf?.addJobs({
'build': {
runsOn: ['ubuntu-latest'],
permissions: { contents: JobPermission.WRITE },
steps: [
{
name: 'Checkout',
uses: 'actions/checkout@v4',
with:
{
ref: '${{github.event.pull_request.head.ref}}',
repository: '${{github.event.pull_request.head.repo.full_name}}',
},
},
{ name: 'Install dependencies', run: 'npm install' },
{ name: 'build', run: 'npx projen compile' },
{
name: 'Upload artifact',
uses: 'actions/[email protected]',
with: { name: 'integ-artifact', path: 'lib/\n.jsii', overwrite: true },
},
],
},
'test-yarn-existing': {
runsOn: ['ubuntu-latest'],
needs: ['build'],
permissions: {},
steps: [
{ name: 'Checkout', uses: 'actions/checkout@v4' },
{ name: 'Download artifact', uses: 'actions/download-artifact@v4', with: { name: 'integ-artifact' } },
{ name: 'Run yalc', run: 'npx yalc publish' },
{ name: 'Add yalc', run: 'cd integ/existing && npx yalc add projen-pipelines' },
{ name: 'Run Test', run: 'cd integ/existing && npx yarn install' },
],
},
'test-npm-existing': {
runsOn: ['ubuntu-latest'],
needs: ['build'],
permissions: {},
steps: [
{ name: 'Checkout', uses: 'actions/checkout@v4' },
{ name: 'Download artifact', uses: 'actions/download-artifact@v4', with: { name: 'integ-artifact' } },
{ name: 'Run yalc', run: 'npx yalc publish' },
{ name: 'Add yalc', run: 'cd integ/existing && npx yalc add projen-pipelines' },
{ name: 'Run Test', run: 'cd integ/existing && npx npm install' },
],
},
});
project.synth();