@cdktf/provider-acme 3.0.11 → 4.0.0
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 +3 -1
- package/.jsii +4 -4
- package/lib/certificate/index.js +7 -7
- package/lib/provider/index.js +1 -1
- package/lib/registration/index.js +2 -2
- package/package.json +48 -11
- package/scripts/check-for-upgrades.js +148 -0
- package/scripts/should-release.js +74 -0
package/.gitattributes
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
/.gitattributes linguist-generated
|
|
4
4
|
/.github/ISSUE_TEMPLATE/config.yml linguist-generated
|
|
5
5
|
/.github/pull_request_template.md linguist-generated
|
|
6
|
-
/.github/workflows/automerge.yml linguist-generated
|
|
7
6
|
/.github/workflows/build.yml linguist-generated
|
|
8
7
|
/.github/workflows/next-cdktf-version-pr.yml linguist-generated
|
|
9
8
|
/.github/workflows/provider-upgrade.yml linguist-generated
|
|
@@ -11,6 +10,7 @@
|
|
|
11
10
|
/.github/workflows/release.yml linguist-generated
|
|
12
11
|
/.github/workflows/upgrade-main.yml linguist-generated
|
|
13
12
|
/.gitignore linguist-generated
|
|
13
|
+
/.mergify.yml linguist-generated
|
|
14
14
|
/.npmignore linguist-generated
|
|
15
15
|
/.projen/** linguist-generated
|
|
16
16
|
/.projen/deps.json linguist-generated
|
|
@@ -21,5 +21,7 @@
|
|
|
21
21
|
/LICENSE linguist-generated
|
|
22
22
|
/package.json linguist-generated
|
|
23
23
|
/README.md linguist-generated
|
|
24
|
+
/scripts/check-for-upgrades.js linguist-generated
|
|
25
|
+
/scripts/should-release.js linguist-generated
|
|
24
26
|
/tsconfig.dev.json linguist-generated
|
|
25
27
|
/yarn.lock linguist-generated
|
package/.jsii
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"url": "https://hashicorp.com"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"cdktf": "^0.
|
|
11
|
+
"cdktf": "^0.14.0",
|
|
12
12
|
"constructs": "^10.0.0"
|
|
13
13
|
},
|
|
14
14
|
"dependencyClosure": {
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"stability": "stable"
|
|
73
73
|
},
|
|
74
74
|
"homepage": "https://github.com/cdktf/cdktf-provider-acme.git",
|
|
75
|
-
"jsiiVersion": "1.
|
|
75
|
+
"jsiiVersion": "1.71.0 (build f1f58ae)",
|
|
76
76
|
"keywords": [
|
|
77
77
|
"acme",
|
|
78
78
|
"cdk",
|
|
@@ -3363,6 +3363,6 @@
|
|
|
3363
3363
|
"symbolId": "src/registration/index:RegistrationExternalAccountBindingOutputReference"
|
|
3364
3364
|
}
|
|
3365
3365
|
},
|
|
3366
|
-
"version": "
|
|
3367
|
-
"fingerprint": "
|
|
3366
|
+
"version": "4.0.0",
|
|
3367
|
+
"fingerprint": "B4GV2ZUiQlyg3PT5przLU6Bk4jr7jfTgs7AmR/S8cqg="
|
|
3368
3368
|
}
|
package/lib/certificate/index.js
CHANGED
|
@@ -88,7 +88,7 @@ class CertificateDnsChallengeOutputReference extends cdktf.ComplexObject {
|
|
|
88
88
|
}
|
|
89
89
|
exports.CertificateDnsChallengeOutputReference = CertificateDnsChallengeOutputReference;
|
|
90
90
|
_a = JSII_RTTI_SYMBOL_1;
|
|
91
|
-
CertificateDnsChallengeOutputReference[_a] = { fqn: "@cdktf/provider-acme.certificate.CertificateDnsChallengeOutputReference", version: "
|
|
91
|
+
CertificateDnsChallengeOutputReference[_a] = { fqn: "@cdktf/provider-acme.certificate.CertificateDnsChallengeOutputReference", version: "4.0.0" };
|
|
92
92
|
class CertificateDnsChallengeList extends cdktf.ComplexList {
|
|
93
93
|
/**
|
|
94
94
|
* @param terraformResource The parent resource
|
|
@@ -110,7 +110,7 @@ class CertificateDnsChallengeList extends cdktf.ComplexList {
|
|
|
110
110
|
}
|
|
111
111
|
exports.CertificateDnsChallengeList = CertificateDnsChallengeList;
|
|
112
112
|
_b = JSII_RTTI_SYMBOL_1;
|
|
113
|
-
CertificateDnsChallengeList[_b] = { fqn: "@cdktf/provider-acme.certificate.CertificateDnsChallengeList", version: "
|
|
113
|
+
CertificateDnsChallengeList[_b] = { fqn: "@cdktf/provider-acme.certificate.CertificateDnsChallengeList", version: "4.0.0" };
|
|
114
114
|
function certificateHttpChallengeToTerraform(struct) {
|
|
115
115
|
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
|
|
116
116
|
return struct;
|
|
@@ -187,7 +187,7 @@ class CertificateHttpChallengeOutputReference extends cdktf.ComplexObject {
|
|
|
187
187
|
}
|
|
188
188
|
exports.CertificateHttpChallengeOutputReference = CertificateHttpChallengeOutputReference;
|
|
189
189
|
_c = JSII_RTTI_SYMBOL_1;
|
|
190
|
-
CertificateHttpChallengeOutputReference[_c] = { fqn: "@cdktf/provider-acme.certificate.CertificateHttpChallengeOutputReference", version: "
|
|
190
|
+
CertificateHttpChallengeOutputReference[_c] = { fqn: "@cdktf/provider-acme.certificate.CertificateHttpChallengeOutputReference", version: "4.0.0" };
|
|
191
191
|
function certificateHttpMemcachedChallengeToTerraform(struct) {
|
|
192
192
|
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
|
|
193
193
|
return struct;
|
|
@@ -241,7 +241,7 @@ class CertificateHttpMemcachedChallengeOutputReference extends cdktf.ComplexObje
|
|
|
241
241
|
}
|
|
242
242
|
exports.CertificateHttpMemcachedChallengeOutputReference = CertificateHttpMemcachedChallengeOutputReference;
|
|
243
243
|
_d = JSII_RTTI_SYMBOL_1;
|
|
244
|
-
CertificateHttpMemcachedChallengeOutputReference[_d] = { fqn: "@cdktf/provider-acme.certificate.CertificateHttpMemcachedChallengeOutputReference", version: "
|
|
244
|
+
CertificateHttpMemcachedChallengeOutputReference[_d] = { fqn: "@cdktf/provider-acme.certificate.CertificateHttpMemcachedChallengeOutputReference", version: "4.0.0" };
|
|
245
245
|
function certificateHttpWebrootChallengeToTerraform(struct) {
|
|
246
246
|
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
|
|
247
247
|
return struct;
|
|
@@ -295,7 +295,7 @@ class CertificateHttpWebrootChallengeOutputReference extends cdktf.ComplexObject
|
|
|
295
295
|
}
|
|
296
296
|
exports.CertificateHttpWebrootChallengeOutputReference = CertificateHttpWebrootChallengeOutputReference;
|
|
297
297
|
_e = JSII_RTTI_SYMBOL_1;
|
|
298
|
-
CertificateHttpWebrootChallengeOutputReference[_e] = { fqn: "@cdktf/provider-acme.certificate.CertificateHttpWebrootChallengeOutputReference", version: "
|
|
298
|
+
CertificateHttpWebrootChallengeOutputReference[_e] = { fqn: "@cdktf/provider-acme.certificate.CertificateHttpWebrootChallengeOutputReference", version: "4.0.0" };
|
|
299
299
|
function certificateTlsChallengeToTerraform(struct) {
|
|
300
300
|
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
|
|
301
301
|
return struct;
|
|
@@ -352,7 +352,7 @@ class CertificateTlsChallengeOutputReference extends cdktf.ComplexObject {
|
|
|
352
352
|
}
|
|
353
353
|
exports.CertificateTlsChallengeOutputReference = CertificateTlsChallengeOutputReference;
|
|
354
354
|
_f = JSII_RTTI_SYMBOL_1;
|
|
355
|
-
CertificateTlsChallengeOutputReference[_f] = { fqn: "@cdktf/provider-acme.certificate.CertificateTlsChallengeOutputReference", version: "
|
|
355
|
+
CertificateTlsChallengeOutputReference[_f] = { fqn: "@cdktf/provider-acme.certificate.CertificateTlsChallengeOutputReference", version: "4.0.0" };
|
|
356
356
|
/**
|
|
357
357
|
* Represents a {@link https://www.terraform.io/docs/providers/acme/r/certificate acme_certificate}
|
|
358
358
|
*/
|
|
@@ -714,7 +714,7 @@ class Certificate extends cdktf.TerraformResource {
|
|
|
714
714
|
}
|
|
715
715
|
exports.Certificate = Certificate;
|
|
716
716
|
_g = JSII_RTTI_SYMBOL_1;
|
|
717
|
-
Certificate[_g] = { fqn: "@cdktf/provider-acme.certificate.Certificate", version: "
|
|
717
|
+
Certificate[_g] = { fqn: "@cdktf/provider-acme.certificate.Certificate", version: "4.0.0" };
|
|
718
718
|
// =================
|
|
719
719
|
// STATIC PROPERTIES
|
|
720
720
|
// =================
|
package/lib/provider/index.js
CHANGED
|
@@ -66,7 +66,7 @@ class AcmeProvider extends cdktf.TerraformProvider {
|
|
|
66
66
|
}
|
|
67
67
|
exports.AcmeProvider = AcmeProvider;
|
|
68
68
|
_a = JSII_RTTI_SYMBOL_1;
|
|
69
|
-
AcmeProvider[_a] = { fqn: "@cdktf/provider-acme.provider.AcmeProvider", version: "
|
|
69
|
+
AcmeProvider[_a] = { fqn: "@cdktf/provider-acme.provider.AcmeProvider", version: "4.0.0" };
|
|
70
70
|
// =================
|
|
71
71
|
// STATIC PROPERTIES
|
|
72
72
|
// =================
|
|
@@ -74,7 +74,7 @@ class RegistrationExternalAccountBindingOutputReference extends cdktf.ComplexObj
|
|
|
74
74
|
}
|
|
75
75
|
exports.RegistrationExternalAccountBindingOutputReference = RegistrationExternalAccountBindingOutputReference;
|
|
76
76
|
_a = JSII_RTTI_SYMBOL_1;
|
|
77
|
-
RegistrationExternalAccountBindingOutputReference[_a] = { fqn: "@cdktf/provider-acme.registration.RegistrationExternalAccountBindingOutputReference", version: "
|
|
77
|
+
RegistrationExternalAccountBindingOutputReference[_a] = { fqn: "@cdktf/provider-acme.registration.RegistrationExternalAccountBindingOutputReference", version: "4.0.0" };
|
|
78
78
|
/**
|
|
79
79
|
* Represents a {@link https://www.terraform.io/docs/providers/acme/r/registration acme_registration}
|
|
80
80
|
*/
|
|
@@ -176,7 +176,7 @@ class Registration extends cdktf.TerraformResource {
|
|
|
176
176
|
}
|
|
177
177
|
exports.Registration = Registration;
|
|
178
178
|
_b = JSII_RTTI_SYMBOL_1;
|
|
179
|
-
Registration[_b] = { fqn: "@cdktf/provider-acme.registration.Registration", version: "
|
|
179
|
+
Registration[_b] = { fqn: "@cdktf/provider-acme.registration.Registration", version: "4.0.0" };
|
|
180
180
|
// =================
|
|
181
181
|
// STATIC PROPERTIES
|
|
182
182
|
// =================
|
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "npx projen build",
|
|
10
10
|
"bump": "npx projen bump",
|
|
11
|
+
"check-if-new-provider-version": "npx projen check-if-new-provider-version",
|
|
11
12
|
"clobber": "npx projen clobber",
|
|
12
13
|
"compat": "npx projen compat",
|
|
13
14
|
"compile": "jsii --silence-warnings=reserved-word",
|
|
@@ -42,23 +43,25 @@
|
|
|
42
43
|
"organization": true
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
46
|
+
"@actions/core": "^1.1.0",
|
|
45
47
|
"@cdktf/provider-project": "^0.2.8",
|
|
46
48
|
"@types/node": "^14",
|
|
47
|
-
"cdktf": "^0.
|
|
48
|
-
"cdktf-cli": "^0.
|
|
49
|
+
"cdktf": "^0.14.0",
|
|
50
|
+
"cdktf-cli": "^0.14.0",
|
|
49
51
|
"constructs": "^10.0.0",
|
|
50
52
|
"dot-prop": "^5.2.0",
|
|
51
53
|
"jsii": "^1.53.0",
|
|
52
|
-
"jsii-diff": "^1.
|
|
54
|
+
"jsii-diff": "^1.71.0",
|
|
53
55
|
"jsii-docgen": "^4.2.44",
|
|
54
|
-
"jsii-pacmak": "^1.
|
|
55
|
-
"
|
|
56
|
-
"
|
|
56
|
+
"jsii-pacmak": "^1.71.0",
|
|
57
|
+
"node-fetch": "cjs",
|
|
58
|
+
"npm-check-updates": "^16",
|
|
59
|
+
"projen": "^0.65.24",
|
|
57
60
|
"standard-version": "^9",
|
|
58
|
-
"typescript": "^4.
|
|
61
|
+
"typescript": "^4.9.3"
|
|
59
62
|
},
|
|
60
63
|
"peerDependencies": {
|
|
61
|
-
"cdktf": "^0.
|
|
64
|
+
"cdktf": "^0.14.0",
|
|
62
65
|
"constructs": "^10.0.0"
|
|
63
66
|
},
|
|
64
67
|
"keywords": [
|
|
@@ -76,7 +79,7 @@
|
|
|
76
79
|
"publishConfig": {
|
|
77
80
|
"access": "public"
|
|
78
81
|
},
|
|
79
|
-
"version": "
|
|
82
|
+
"version": "4.0.0",
|
|
80
83
|
"types": "lib/index.d.ts",
|
|
81
84
|
"stability": "stable",
|
|
82
85
|
"jsii": {
|
|
@@ -107,6 +110,42 @@
|
|
|
107
110
|
"rootDir": "src"
|
|
108
111
|
}
|
|
109
112
|
},
|
|
113
|
+
"standard-version": {
|
|
114
|
+
"types": [
|
|
115
|
+
{
|
|
116
|
+
"type": "feat",
|
|
117
|
+
"section": "Features"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"type": "fix",
|
|
121
|
+
"section": "Bug Fixes"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"type": "chore",
|
|
125
|
+
"section": "Updates"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"type": "docs",
|
|
129
|
+
"hidden": true
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"type": "style",
|
|
133
|
+
"hidden": true
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"type": "refactor",
|
|
137
|
+
"hidden": true
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"type": "perf",
|
|
141
|
+
"hidden": true
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"type": "test",
|
|
145
|
+
"hidden": true
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
},
|
|
110
149
|
"cdktf": {
|
|
111
150
|
"provider": {
|
|
112
151
|
"name": "registry.terraform.io/vancluever/acme",
|
|
@@ -114,8 +153,6 @@
|
|
|
114
153
|
}
|
|
115
154
|
},
|
|
116
155
|
"resolutions": {
|
|
117
|
-
"@types/responselike": "1.0.0",
|
|
118
|
-
"got": "12.3.1",
|
|
119
156
|
"@types/prettier": "2.6.0"
|
|
120
157
|
},
|
|
121
158
|
"//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"."
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
|
|
2
|
+
const fetch = require("node-fetch");
|
|
3
|
+
const semver = require("semver");
|
|
4
|
+
const actions = require("@actions/core");
|
|
5
|
+
|
|
6
|
+
// Code is inlined below, as this import requires us to add all dev dependencies of cdktf-cli as we're not
|
|
7
|
+
// using the bundle. A better alternative would be to refactor this method to move to its own package, that
|
|
8
|
+
// the cdktf-cli and others can use (we have the same "problem" with some other code in cdktf, cdktf-cli and
|
|
9
|
+
// the @cdktf/provider-generator package, too)
|
|
10
|
+
// const { versionMatchesConstraint } = require('cdktf-cli/lib/dependencies/version-constraints');
|
|
11
|
+
|
|
12
|
+
// set by the projen file that generates this script
|
|
13
|
+
const CONSTRAINT = "~> 2.10";
|
|
14
|
+
const FQ_PROVIDER_NAME = "vancluever/acme";
|
|
15
|
+
|
|
16
|
+
(async function main() {
|
|
17
|
+
if (await newerMatchingProviderVersionExists()) {
|
|
18
|
+
console.log(
|
|
19
|
+
`Found newer Terraform provider version matching the current constraint: ${CONSTRAINT}`
|
|
20
|
+
);
|
|
21
|
+
setGithubStepOutput("new_version", "available");
|
|
22
|
+
} else {
|
|
23
|
+
console.log("No changes detected.");
|
|
24
|
+
setGithubStepOutput("new_version", "unavailable");
|
|
25
|
+
}
|
|
26
|
+
})();
|
|
27
|
+
|
|
28
|
+
function setGithubStepOutput(name, value) {
|
|
29
|
+
actions.setOutput(name, value);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async function newerMatchingProviderVersionExists() {
|
|
33
|
+
const res = await fetch(
|
|
34
|
+
`https://registry.terraform.io/v2/providers/${FQ_PROVIDER_NAME}/provider-versions`
|
|
35
|
+
);
|
|
36
|
+
const body = await res.json();
|
|
37
|
+
|
|
38
|
+
const currentVersion = await getCurrentProviderVersion();
|
|
39
|
+
|
|
40
|
+
const availableVersions = body.data.map((it) => it.attributes.version);
|
|
41
|
+
const versionsMatching = availableVersions.filter((v) =>
|
|
42
|
+
versionMatchesConstraint(v, CONSTRAINT)
|
|
43
|
+
);
|
|
44
|
+
if (versionsMatching.length <= 0) {
|
|
45
|
+
throw new Error(
|
|
46
|
+
`Unexpected Error: Found no matching versions for constraint ${CONSTRAINT} in [${availableVersions.join(
|
|
47
|
+
", "
|
|
48
|
+
)}]`
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const versionsGreaterThanCurrent = versionsMatching.filter((v) =>
|
|
53
|
+
semver.gt(v, currentVersion)
|
|
54
|
+
);
|
|
55
|
+
if (versionsGreaterThanCurrent.length > 0) {
|
|
56
|
+
console.log(
|
|
57
|
+
`One or more matching versions (${CONSTRAINT}) are greater than the current version (${currentVersion}): [${versionsGreaterThanCurrent.join(
|
|
58
|
+
", "
|
|
59
|
+
)}]`
|
|
60
|
+
);
|
|
61
|
+
return true;
|
|
62
|
+
} else {
|
|
63
|
+
console.log(
|
|
64
|
+
`Found no matching versions (${CONSTRAINT}) greater than the current version (${currentVersion}). Matching versions: [${versionsMatching.join(
|
|
65
|
+
", "
|
|
66
|
+
)}]`
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// e.g. cdktf 0.12.x -> 0.13.x but not 0.12.y -> 0.12.z
|
|
73
|
+
async function cdktfVersionMajorChanged() {
|
|
74
|
+
throw new Error("todo implement");
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async function getCurrentProviderVersion() {
|
|
78
|
+
const json = require("../src/version.json");
|
|
79
|
+
return json[`registry.terraform.io/${FQ_PROVIDER_NAME.toLowerCase()}`];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// SEE NOTICE AT THE TOP WHY THIS IS INLINED CURRENTLY
|
|
83
|
+
// copied from https://github.com/hashicorp/terraform-cdk/blob/b23fc173715e90c0a5b8c8633d9ec7f71edf9ed4/packages/cdktf-cli/lib/dependencies/version-constraints.ts
|
|
84
|
+
// and converted to JavaScript
|
|
85
|
+
|
|
86
|
+
// constraints can be prefixed with "~>", ">", "<", "=", ">=", "<=" or "!="
|
|
87
|
+
// no prefix means "="
|
|
88
|
+
function parseConstraint(constraint) {
|
|
89
|
+
const cleaned = constraint.trim();
|
|
90
|
+
|
|
91
|
+
const operator = cleaned.match(/(~>|>=|<=|>|<|=|!=)/)?.[0] || "=";
|
|
92
|
+
const version = cleaned.replace(operator, "").trim();
|
|
93
|
+
|
|
94
|
+
return {
|
|
95
|
+
operator,
|
|
96
|
+
version,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function versionMatchesConstraint(version, constraint) {
|
|
101
|
+
// https://www.terraform.io/language/expressions/version-constraints
|
|
102
|
+
// version can contain multiple constraints split by ","
|
|
103
|
+
|
|
104
|
+
const constraints = constraint.split(",");
|
|
105
|
+
version = semver.coerce(version)?.version ?? version;
|
|
106
|
+
|
|
107
|
+
// each constraint needs to be satisfied
|
|
108
|
+
return constraints.every((c) => {
|
|
109
|
+
const parsed = parseConstraint(c);
|
|
110
|
+
|
|
111
|
+
const cleanedParsedVersion =
|
|
112
|
+
semver.coerce(parsed.version)?.version ?? parsed.version;
|
|
113
|
+
|
|
114
|
+
switch (parsed.operator) {
|
|
115
|
+
case "=":
|
|
116
|
+
return version === cleanedParsedVersion;
|
|
117
|
+
case "!=":
|
|
118
|
+
return version !== cleanedParsedVersion;
|
|
119
|
+
case "~>": {
|
|
120
|
+
// allows rightmost version component to increment
|
|
121
|
+
|
|
122
|
+
// ~>2.0 which allows 2.1 and 2.1.1 needs special handling as
|
|
123
|
+
// npm semver handles "~" differently for ~2.0 than for ~2 or ~2.1.0
|
|
124
|
+
// So we need to use "^" (e.g. ^2.0) for this case
|
|
125
|
+
// see: https://github.com/npm/node-semver/issues/11
|
|
126
|
+
const allowMinorAndPatchOnly = parsed.version.split(".").length === 2;
|
|
127
|
+
|
|
128
|
+
const range = allowMinorAndPatchOnly
|
|
129
|
+
? `^${parsed.version}`
|
|
130
|
+
: `~${parsed.version}`;
|
|
131
|
+
|
|
132
|
+
return semver.satisfies(version, range);
|
|
133
|
+
}
|
|
134
|
+
case ">=":
|
|
135
|
+
return semver.gte(version, cleanedParsedVersion);
|
|
136
|
+
case "<=":
|
|
137
|
+
return semver.lte(version, cleanedParsedVersion);
|
|
138
|
+
case ">":
|
|
139
|
+
return semver.gt(version, cleanedParsedVersion);
|
|
140
|
+
case "<":
|
|
141
|
+
return semver.lt(version, cleanedParsedVersion);
|
|
142
|
+
default:
|
|
143
|
+
throw Errors.External(
|
|
144
|
+
`Unknown constraint operator: ${parsed.operator} in version constraint ${constraint}`
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
|
|
2
|
+
// Note: This script is currently not handling pre-releases
|
|
3
|
+
const execSync = require("child_process").execSync;
|
|
4
|
+
|
|
5
|
+
(async function main() {
|
|
6
|
+
console.log(
|
|
7
|
+
"Determining whether changes warrant a new release. Non-zero exit code indicates that a release should be skipped"
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
// inspired by https://github.com/projen/projen/blob/08378c40d1453288053abcddce82475329b4506e/src/release/bump-version.ts#L281
|
|
11
|
+
const prefixFilter = `v*`;
|
|
12
|
+
const listGitTags = [
|
|
13
|
+
"git",
|
|
14
|
+
'-c "versionsort.suffix=-"', // makes sure pre-release versions are listed after the primary version
|
|
15
|
+
"tag",
|
|
16
|
+
'--sort="-version:refname"', // sort as versions and not lexicographically
|
|
17
|
+
"--list",
|
|
18
|
+
`"${prefixFilter}"`,
|
|
19
|
+
].join(" ");
|
|
20
|
+
|
|
21
|
+
const stdout = execSync(listGitTags).toString();
|
|
22
|
+
const tags = stdout.split("\n");
|
|
23
|
+
|
|
24
|
+
if (tags.length > 0 && tags[0].trim() !== "") {
|
|
25
|
+
const latestTag = tags[0];
|
|
26
|
+
console.log(`Found latest tag ${latestTag}`);
|
|
27
|
+
|
|
28
|
+
const previousPackageJsonGit = [
|
|
29
|
+
"git",
|
|
30
|
+
"show",
|
|
31
|
+
`${latestTag}:package.json`,
|
|
32
|
+
].join(" ");
|
|
33
|
+
const prevPackageJson = JSON.parse(
|
|
34
|
+
execSync(previousPackageJsonGit).toString()
|
|
35
|
+
);
|
|
36
|
+
const currPackageJson = require("../package.json");
|
|
37
|
+
|
|
38
|
+
const thingsToDiff = [
|
|
39
|
+
{
|
|
40
|
+
name: "Terraform provider version",
|
|
41
|
+
previous: prevPackageJson.cdktf.provider.version,
|
|
42
|
+
current: currPackageJson.cdktf.provider.version,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "cdktf peer dependency",
|
|
46
|
+
previous: prevPackageJson.peerDependencies.cdktf,
|
|
47
|
+
current: currPackageJson.peerDependencies.cdktf,
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
thingsToDiff.forEach((x) =>
|
|
52
|
+
console.log(
|
|
53
|
+
`${x.name}: ${x.previous} => ${x.current} ${
|
|
54
|
+
x.current !== x.previous ? "<<CHANGED" : ""
|
|
55
|
+
}`
|
|
56
|
+
)
|
|
57
|
+
);
|
|
58
|
+
const changes = thingsToDiff.some((x) => x.previous !== x.current);
|
|
59
|
+
if (changes) {
|
|
60
|
+
console.log(
|
|
61
|
+
"Found one or more relevant changes, not skipping the release."
|
|
62
|
+
);
|
|
63
|
+
} else {
|
|
64
|
+
console.log(
|
|
65
|
+
"No changes in versions detected, skipping the release via exit code 1"
|
|
66
|
+
);
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
} else {
|
|
70
|
+
console.log(
|
|
71
|
+
"No git tags found, this seems to be the first release, hence not skipping it."
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
})();
|