jsii-release 0.2.670 → 0.2.672
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitattributes +1 -1
- package/.projenrc.ts +146 -0
- package/package.json +4 -4
- package/package.json.bak +4 -4
package/.gitattributes
CHANGED
package/.projenrc.ts
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { readdirSync } from 'fs';
|
|
2
|
+
import { typescript, github } from 'projen';
|
|
3
|
+
|
|
4
|
+
const project = new typescript.TypeScriptProject({
|
|
5
|
+
projenrcTs: true,
|
|
6
|
+
defaultReleaseBranch: 'main',
|
|
7
|
+
name: 'publib',
|
|
8
|
+
description: 'Release jsii modules to multiple package managers',
|
|
9
|
+
releaseToNpm: true,
|
|
10
|
+
repository: 'https://github.com/cdklabs/publib.git',
|
|
11
|
+
authorName: 'Amazon Web Services',
|
|
12
|
+
authorOrganization: true,
|
|
13
|
+
authorUrl: 'https://aws.amazon.com',
|
|
14
|
+
homepage: 'https://github.com/cdklabs/publib',
|
|
15
|
+
autoApproveOptions: {
|
|
16
|
+
allowedUsernames: ['cdklabs-automation'],
|
|
17
|
+
secret: 'GITHUB_TOKEN',
|
|
18
|
+
},
|
|
19
|
+
devDeps: [
|
|
20
|
+
'ts-node',
|
|
21
|
+
'@aws-sdk/client-sts',
|
|
22
|
+
],
|
|
23
|
+
autoApproveUpgrades: true,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// we can't use 9.x because it doesn't work with node 10.
|
|
27
|
+
const fsExtraVersion = '^8.0.0';
|
|
28
|
+
|
|
29
|
+
project.addDeps('shlex', `fs-extra@${fsExtraVersion}`, `@types/fs-extra@${fsExtraVersion}`);
|
|
30
|
+
|
|
31
|
+
const legacy = project.addTask('package-legacy');
|
|
32
|
+
legacy.exec('cp package.json package.json.bak');
|
|
33
|
+
legacy.exec('node ./scripts/update-package-name.js jsii-release');
|
|
34
|
+
legacy.exec('npm pack');
|
|
35
|
+
legacy.exec('mv ./jsii-release*.tgz dist/js');
|
|
36
|
+
legacy.exec('cp package.json.bak package.json');
|
|
37
|
+
legacy.exec('rm package.json.bak');
|
|
38
|
+
|
|
39
|
+
project.packageTask.spawn(legacy);
|
|
40
|
+
|
|
41
|
+
// map all "jsii-release-*" to "jsii-release-shim" as executables
|
|
42
|
+
for (const f of readdirSync('./bin').filter(file => file.startsWith('publib'))) {
|
|
43
|
+
const shim = ['jsii-release', f.split('-')[1]].filter(x => x).join('-');
|
|
44
|
+
project.addBins({ [shim]: './bin/jsii-release-shim' });
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
//////////////////////////////////////////////////////////////////////
|
|
48
|
+
|
|
49
|
+
const test = github.GitHub.of(project)?.addWorkflow('integ');
|
|
50
|
+
test?.on({
|
|
51
|
+
pullRequestTarget: {
|
|
52
|
+
types: [
|
|
53
|
+
'labeled',
|
|
54
|
+
'opened',
|
|
55
|
+
'synchronize',
|
|
56
|
+
'reopened',
|
|
57
|
+
'ready_for_review',
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
mergeGroup: {},
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
// Select `IntegTestCredentials` or `IntegTestCredentialsRequireApproval` depending on the author of the PR
|
|
64
|
+
// github.pull_request.author_association in ['OWNER', 'COLLABORATOR', 'MEMBER', 'NONE']
|
|
65
|
+
// github.pull_request.user.login
|
|
66
|
+
// Because we have an 'if/else' condition that is quite annoying to encode with outputs, have a mutable variable by
|
|
67
|
+
// means of a file on disk, export it as an output afterwards.
|
|
68
|
+
test?.addJob('targetenv', {
|
|
69
|
+
permissions: {
|
|
70
|
+
contents: github.workflows.JobPermission.READ,
|
|
71
|
+
},
|
|
72
|
+
runsOn: ['ubuntu-latest'],
|
|
73
|
+
steps: [
|
|
74
|
+
{
|
|
75
|
+
name: 'Print event output for debugging in case the condition is incorrect',
|
|
76
|
+
run: 'cat $GITHUB_EVENT_PATH',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'Start requiring approval',
|
|
80
|
+
run: 'echo IntegTestCredentialsRequireApproval > .envname',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'If maintainer, do not need approval',
|
|
84
|
+
if: [
|
|
85
|
+
'github.pull_request.author_association == \'OWNER\'',
|
|
86
|
+
'github.pull_request.author_association == \'MEMBER\'',
|
|
87
|
+
'github.pull_request.user.login == \'cdklabs-automation\'',
|
|
88
|
+
].join(' || '),
|
|
89
|
+
run: 'echo IntegTestCredentials > .envname',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: 'output',
|
|
93
|
+
name: 'Output the value',
|
|
94
|
+
run: 'echo "env_name=$(cat .envname)" >> "$GITHUB_OUTPUT"',
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
outputs: {
|
|
98
|
+
env_name: { stepId: 'output', outputName: 'env_name' },
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
test?.addJob('test', {
|
|
102
|
+
permissions: {
|
|
103
|
+
contents: github.workflows.JobPermission.READ,
|
|
104
|
+
idToken: github.workflows.JobPermission.WRITE,
|
|
105
|
+
},
|
|
106
|
+
runsOn: ['ubuntu-latest'],
|
|
107
|
+
needs: ['targetenv'],
|
|
108
|
+
environment: '${{needs.targetenv.outputs.env_name}}',
|
|
109
|
+
steps: [
|
|
110
|
+
{
|
|
111
|
+
name: 'Federate into AWS',
|
|
112
|
+
uses: 'aws-actions/configure-aws-credentials@v2',
|
|
113
|
+
with: {
|
|
114
|
+
'aws-region': 'us-east-1',
|
|
115
|
+
'role-to-assume': '${{ secrets.AWS_ROLE_TO_ASSUME }}',
|
|
116
|
+
'role-session-name': 'publib-integ-test',
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'Checkout',
|
|
121
|
+
uses: 'actions/checkout@v3',
|
|
122
|
+
with: {
|
|
123
|
+
ref: '${{ github.event.pull_request.head.ref }}',
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: 'Setup Node.js',
|
|
128
|
+
uses: 'actions/setup-node@v3',
|
|
129
|
+
with: {
|
|
130
|
+
'node-version': '16.16.0',
|
|
131
|
+
'cache': 'yarn',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: 'Yarn install',
|
|
136
|
+
run: 'yarn install --frozen-lockfile',
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'Run integration tests',
|
|
140
|
+
// Replace the 'testMatch' in package.json
|
|
141
|
+
run: 'npx jest --testMatch "<rootDir>/test/**/*.integ.ts"',
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
project.synth();
|
package/package.json
CHANGED
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"organization": true
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@aws-sdk/client-sts": "^3.
|
|
50
|
+
"@aws-sdk/client-sts": "^3.325.0",
|
|
51
51
|
"@types/jest": "^27.5.2",
|
|
52
52
|
"@types/node": "^16",
|
|
53
53
|
"@typescript-eslint/eslint-plugin": "^5",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"jest": "^27.5.1",
|
|
60
60
|
"jest-junit": "^15",
|
|
61
61
|
"npm-check-updates": "^16",
|
|
62
|
-
"projen": "^0.71.
|
|
62
|
+
"projen": "^0.71.36",
|
|
63
63
|
"standard-version": "^9",
|
|
64
64
|
"ts-jest": "^27.1.5",
|
|
65
65
|
"ts-node": "^10.9.1",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"main": "lib/index.js",
|
|
74
74
|
"license": "Apache-2.0",
|
|
75
75
|
"homepage": "https://github.com/cdklabs/publib",
|
|
76
|
-
"version": "0.2.
|
|
76
|
+
"version": "0.2.672",
|
|
77
77
|
"jest": {
|
|
78
78
|
"testMatch": [
|
|
79
79
|
"<rootDir>/src/**/__tests__/**/*.ts?(x)",
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
}
|
|
116
116
|
},
|
|
117
117
|
"types": "lib/index.d.ts",
|
|
118
|
-
"//": "~~ Generated by projen. To modify, edit .projenrc.
|
|
118
|
+
"//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"."
|
|
119
119
|
}
|
package/package.json.bak
CHANGED
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"organization": true
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@aws-sdk/client-sts": "^3.
|
|
50
|
+
"@aws-sdk/client-sts": "^3.325.0",
|
|
51
51
|
"@types/jest": "^27.5.2",
|
|
52
52
|
"@types/node": "^16",
|
|
53
53
|
"@typescript-eslint/eslint-plugin": "^5",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"jest": "^27.5.1",
|
|
60
60
|
"jest-junit": "^15",
|
|
61
61
|
"npm-check-updates": "^16",
|
|
62
|
-
"projen": "^0.71.
|
|
62
|
+
"projen": "^0.71.36",
|
|
63
63
|
"standard-version": "^9",
|
|
64
64
|
"ts-jest": "^27.1.5",
|
|
65
65
|
"ts-node": "^10.9.1",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"main": "lib/index.js",
|
|
74
74
|
"license": "Apache-2.0",
|
|
75
75
|
"homepage": "https://github.com/cdklabs/publib",
|
|
76
|
-
"version": "0.2.
|
|
76
|
+
"version": "0.2.672",
|
|
77
77
|
"jest": {
|
|
78
78
|
"testMatch": [
|
|
79
79
|
"<rootDir>/src/**/__tests__/**/*.ts?(x)",
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
}
|
|
116
116
|
},
|
|
117
117
|
"types": "lib/index.d.ts",
|
|
118
|
-
"//": "~~ Generated by projen. To modify, edit .projenrc.
|
|
118
|
+
"//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"."
|
|
119
119
|
}
|