-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.projenrc.ts
159 lines (150 loc) · 3.87 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
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
157
158
159
import { ReleasableCommits, awscdk } from 'projen';
import { JobPermission } from 'projen/lib/github/workflows-model';
import { TrailingComma } from 'projen/lib/javascript';
const project = new awscdk.AwsCdkConstructLibrary({
author: 'Antonio Márquez Pérez',
authorAddress: 'antonio.marquez@jumptothecloud.tech',
cdkVersion: '2.122.0',
defaultReleaseBranch: 'main',
jsiiVersion: '~5.3.0',
name: '@jttc/aws-codestarconnection',
projenrcTs: true,
constructsVersion: '10.3.0',
repositoryUrl: 'https://github.com/JumpToTheCloud/aws-codestarconnection',
prettier: true,
keywords: ['aws', 'cdk', 'codestarconnection'],
publishToPypi: {
distName: 'aws-codestarconnection',
module: 'aws_codestarconnection',
},
prettierOptions: {
settings: {
trailingComma: TrailingComma.ES5,
singleQuote: true,
bracketSpacing: true,
semi: true,
},
},
jestOptions: {
jestConfig: {
verbose: true,
},
},
github: true,
releasableCommits: ReleasableCommits.featuresAndFixes(),
releaseFailureIssue: true,
deps: [] /* Runtime dependencies of this module. */,
peerDeps: [] /* Peer dependencies of this module. */,
description:
'AWS CDK L2 construct for aws code star connection' /* The description is just a string that helps people understand the purpose of the package. */,
devDeps: [
'commitizen',
'cz-customizable',
] /* Build dependencies for this module. */,
packageName: '@jttc/aws-codestarconnection' /* The "name" in package.json. */,
});
project.addScripts({
commit: './node_modules/cz-customizable/standalone.js',
});
project.addGitIgnore('site');
project.prettier?.addIgnorePattern('*.md');
project.addTask('docs:build', {
exec: 'mkdocs build',
});
project.addTask('docs:serve', {
exec: 'mkdocs serve -a localhost:8099',
});
const deployDocs = project.github?.addWorkflow('deploy-docs');
deployDocs?.on({
workflowDispatch: {},
workflowRun: {
workflows: ['release'],
types: ['completed'],
},
workflowCall: {
inputs: {
version: {
required: true,
type: 'string',
description: 'Version to build and publish docs',
},
alias: {
required: true,
type: 'string',
description: 'Alias to associate version (latest, stage)',
},
},
},
});
deployDocs?.addJob('deploy-docs', {
permissions: {
contents: JobPermission.WRITE,
pages: JobPermission.WRITE,
},
runsOn: ['ubuntu-latest'],
outputs: {
getVersion: {
stepId: 'getVersion',
outputName: 'version',
},
},
steps: [
{
uses: 'actions/checkout@v4',
with: {
'fetch-depth': 0,
},
},
{
uses: 'actions/setup-python@v4',
with: {
pythonVersion: '3.8',
},
},
{
run: 'echo "cache_id=$(date --utc "+%V")" >> $GITHUB_ENV',
},
{
uses: 'actions/cache@v3',
with: {
key: 'mkdocs-material-${{ env.cache_id }}',
path: '.cache',
},
},
{
name: 'Install doc generations dependencies',
run: [
'pip install --upgrade pip',
'pip install -r docs/requirements.txt',
].join('\n'),
},
{
name: 'Setup docs deploy',
run: [
'git config user.name github-actions',
'git config user.email github-actions@github.com',
].join('\n'),
},
{
name: 'Get the version',
id: 'getVersion',
run: [
'echo "version=$(git describe --tags --abbrev=0)"',
'echo "version=$(git describe --tags --abbrev=0)" >> "$GITHUB_OUTPUT"',
].join('\n'),
},
{
name: 'Build and deploy documentation',
env: {
ALIAS: 'latest',
VERSION: '${{ needs.deploy-docs.outputs.version }}',
},
run: [
'echo ${{ env.VERSION }}',
'mkdocs build',
'mkdocs gh-deploy --force',
].join('\n'),
},
],
});
project.synth();