-
Notifications
You must be signed in to change notification settings - Fork 3
/
.projenrc.ts
94 lines (85 loc) · 2.47 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
import { JsiiProject } from 'projen/lib/cdk';
import { Job } from 'projen/lib/github/workflows-model';
import { ReleaseTrigger } from 'projen/lib/release';
import { BundleKics } from './projenrc';
const project = new JsiiProject({
author: 'Checkmarx',
authorAddress: '[email protected]',
defaultReleaseBranch: 'main',
devDeps: [
'cdklabs-projen-project-types',
'@octokit/types',
'@octokit/rest',
'mock-fs',
'@types/mock-fs',
'fs-extra',
'@types/fs-extra',
'constructs',
'aws-cdk-lib',
],
name: '@checkmarx/cdk-validator-kics',
projenrcTs: true,
release: true,
releaseTrigger: ReleaseTrigger.continuous(),
repositoryUrl: 'https://github.com/Checkmarx/kics-cdk-validator-plugin.git',
deps: [
'aws-cdk-lib',
],
peerDeps: [
'aws-cdk-lib',
],
description: 'A KICS plugin for AWS CDK',
majorVersion: 2,
});
project.tsconfig?.addInclude('projenrc/**/*.ts');
project.gitignore.exclude('bin');
project.gitignore.exclude('assets');
// Super hacky way to add a step to a workflow that projen itself generates
const buildWorkflow = project.github?. tryFindWorkflow('build');
if (buildWorkflow != null) {
const buildJob = buildWorkflow.getJob('build');
if (isJob(buildJob)) {
buildWorkflow.updateJob('build', {
...buildJob,
steps: [
{
uses: 'actions/setup-go@v5',
with: { 'go-version': '1.22.x' },
},
{ run: 'go install github.com/goreleaser/goreleaser@latest' },
{
name: 'Add goreleaser to PATH',
run: 'echo "PATH=$(go env GOPATH)/bin:$PATH" >> $GITHUB_ENV',
},
...(buildJob.steps as any)(),
],
});
}
}
// Super hacky way to add a step to a workflow that projen itself generates
const releaseWorkflow = project.github?. tryFindWorkflow('release');
if (releaseWorkflow != null) {
const releaseJob = releaseWorkflow.getJob('release');
if (isJob(releaseJob)) {
releaseWorkflow.updateJob('release', {
...releaseJob,
steps: [
{
uses: 'actions/setup-go@v5',
with: { 'go-version': '1.22.x' },
},
{ run: 'go install github.com/goreleaser/goreleaser@latest' },
{
name: 'Add goreleaser to PATH',
run: 'echo "PATH=$(go env GOPATH)/bin:$PATH" >> $GITHUB_ENV',
},
...releaseJob.steps,
],
});
}
}
new BundleKics(project);
project.synth();
function isJob(job: any): job is Job {
return job != null && job.hasOwnProperty('steps');
}