@cloudsnorkel/cdk-github-runners 0.9.5 → 0.9.7
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 +2 -0
- package/.jsii +118 -101
- package/API.md +28 -15
- package/README.md +120 -63
- package/assets/delete-runner.lambda/index.js +69 -63
- package/assets/image-builders/aws-image-builder/reaper.lambda/index.js +163 -0
- package/assets/image-builders/aws-image-builder/versioner.lambda/index.js +69 -63
- package/assets/status.lambda/index.js +69 -63
- package/assets/token-retriever.lambda/index.js +69 -63
- package/cdk.json +10 -0
- package/lib/access.js +1 -1
- package/lib/image-builders/api.js +1 -1
- package/lib/image-builders/aws-image-builder/builder.d.ts +1 -1
- package/lib/image-builders/aws-image-builder/builder.js +62 -26
- package/lib/image-builders/aws-image-builder/deprecated/ami.d.ts +2 -2
- package/lib/image-builders/aws-image-builder/deprecated/ami.js +4 -4
- package/lib/image-builders/aws-image-builder/deprecated/container.d.ts +3 -3
- package/lib/image-builders/aws-image-builder/deprecated/container.js +11 -14
- package/lib/image-builders/aws-image-builder/deprecated/linux-components.js +1 -1
- package/lib/image-builders/aws-image-builder/deprecated/windows-components.js +1 -1
- package/lib/image-builders/aws-image-builder/reaper-function.d.ts +13 -0
- package/lib/image-builders/aws-image-builder/reaper-function.js +23 -0
- package/lib/image-builders/aws-image-builder/reaper.lambda.d.ts +1 -0
- package/lib/image-builders/aws-image-builder/reaper.lambda.js +149 -0
- package/lib/image-builders/codebuild-deprecated.d.ts +4 -4
- package/lib/image-builders/codebuild-deprecated.js +18 -22
- package/lib/image-builders/codebuild.d.ts +1 -1
- package/lib/image-builders/codebuild.js +24 -25
- package/lib/image-builders/common.d.ts +2 -2
- package/lib/image-builders/common.js +1 -1
- package/lib/image-builders/components.js +4 -4
- package/lib/image-builders/static.d.ts +1 -1
- package/lib/image-builders/static.js +7 -6
- package/lib/providers/codebuild.js +2 -2
- package/lib/providers/common.d.ts +6 -0
- package/lib/providers/common.js +4 -4
- package/lib/providers/ec2.d.ts +1 -1
- package/lib/providers/ec2.js +3 -3
- package/lib/providers/ecs.d.ts +6 -2
- package/lib/providers/ecs.js +64 -32
- package/lib/providers/fargate.js +2 -2
- package/lib/providers/lambda.js +12 -3
- package/lib/runner.d.ts +3 -3
- package/lib/runner.js +5 -5
- package/lib/secrets.js +1 -1
- package/package.json +7 -5
package/API.md
CHANGED
|
@@ -29,8 +29,8 @@ builder.addComponent(new ImageBuilderComponent(scope, id, {
|
|
|
29
29
|
'apt-get install p7zip',
|
|
30
30
|
],
|
|
31
31
|
}));
|
|
32
|
-
new
|
|
33
|
-
|
|
32
|
+
new Ec2RunnerProvider(this, 'EC2 provider', {
|
|
33
|
+
labels: ['custom-ec2'],
|
|
34
34
|
amiBuilder: builder,
|
|
35
35
|
});
|
|
36
36
|
```
|
|
@@ -240,13 +240,13 @@ For example, to set a specific runner version, rebuild the image every 2 weeks,
|
|
|
240
240
|
|
|
241
241
|
```
|
|
242
242
|
const builder = new CodeBuildImageBuilder(this, 'Builder', {
|
|
243
|
-
dockerfilePath:
|
|
243
|
+
dockerfilePath: FargateRunnerProvider.LINUX_X64_DOCKERFILE_PATH,
|
|
244
244
|
runnerVersion: RunnerVersion.specific('2.293.0'),
|
|
245
245
|
rebuildInterval: Duration.days(14),
|
|
246
246
|
});
|
|
247
247
|
builder.setBuildArg('EXTRA_PACKAGES', 'nginx xz-utils');
|
|
248
|
-
new
|
|
249
|
-
|
|
248
|
+
new FargateRunnerProvider(this, 'Fargate provider', {
|
|
249
|
+
labels: ['customized-fargate'],
|
|
250
250
|
imageBuilder: builder,
|
|
251
251
|
});
|
|
252
252
|
```
|
|
@@ -1221,8 +1221,8 @@ const builder = new ContainerImageBuilder(this, 'Builder', {
|
|
|
1221
1221
|
runnerVersion: RunnerVersion.specific('2.293.0'),
|
|
1222
1222
|
rebuildInterval: Duration.days(14),
|
|
1223
1223
|
});
|
|
1224
|
-
new
|
|
1225
|
-
|
|
1224
|
+
new CodeBuildRunnerProvider(this, 'CodeBuild provider', {
|
|
1225
|
+
labels: ['custom-codebuild'],
|
|
1226
1226
|
imageBuilder: builder,
|
|
1227
1227
|
});
|
|
1228
1228
|
```
|
|
@@ -3039,12 +3039,12 @@ const dbSg = ec2.SecurityGroup.fromSecurityGroupId(this, 'database security grou
|
|
|
3039
3039
|
const bucket = new s3.Bucket(this, 'runner bucket');
|
|
3040
3040
|
|
|
3041
3041
|
// create a custom CodeBuild provider
|
|
3042
|
-
const myProvider = new
|
|
3042
|
+
const myProvider = new CodeBuildRunnerProvider(
|
|
3043
3043
|
this, 'codebuild runner',
|
|
3044
3044
|
{
|
|
3045
|
-
|
|
3045
|
+
labels: ['my-codebuild'],
|
|
3046
3046
|
vpc: vpc,
|
|
3047
|
-
|
|
3047
|
+
securityGroups: [runnerSg],
|
|
3048
3048
|
},
|
|
3049
3049
|
);
|
|
3050
3050
|
// grant some permissions to the provider
|
|
@@ -5693,7 +5693,7 @@ public readonly imageBuilder: IRunnerImageBuilder;
|
|
|
5693
5693
|
```
|
|
5694
5694
|
|
|
5695
5695
|
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.IRunnerImageBuilder">IRunnerImageBuilder</a>
|
|
5696
|
-
- *Default:*
|
|
5696
|
+
- *Default:* Ec2RunnerProvider.imageBuilder()
|
|
5697
5697
|
|
|
5698
5698
|
Runner image builder used to build AMI containing GitHub Runner and all requirements.
|
|
5699
5699
|
|
|
@@ -5875,7 +5875,8 @@ const ecsRunnerProviderProps: EcsRunnerProviderProps = { ... }
|
|
|
5875
5875
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.memoryLimitMiB">memoryLimitMiB</a></code> | <code>number</code> | The amount (in MiB) of memory used by the task. |
|
|
5876
5876
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.minInstances">minInstances</a></code> | <code>number</code> | The minimum number of instances to run in the cluster. |
|
|
5877
5877
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.securityGroups">securityGroups</a></code> | <code>aws-cdk-lib.aws_ec2.ISecurityGroup[]</code> | Security groups to assign to the task. |
|
|
5878
|
-
| <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.
|
|
5878
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.spot">spot</a></code> | <code>boolean</code> | Use spot capacity. |
|
|
5879
|
+
| <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.spotMaxPrice">spotMaxPrice</a></code> | <code>string</code> | Maximum price for spot instances. |
|
|
5879
5880
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.storageSize">storageSize</a></code> | <code>aws-cdk-lib.Size</code> | Size of volume available for launched cluster instances. |
|
|
5880
5881
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.subnetSelection">subnetSelection</a></code> | <code>aws-cdk-lib.aws_ec2.SubnetSelection</code> | Subnets to run the runners in. |
|
|
5881
5882
|
| <code><a href="#@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | VPC to launch the runners in. |
|
|
@@ -6087,6 +6088,19 @@ Security groups to assign to the task.
|
|
|
6087
6088
|
|
|
6088
6089
|
---
|
|
6089
6090
|
|
|
6091
|
+
##### `spot`<sup>Optional</sup> <a name="spot" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.spot"></a>
|
|
6092
|
+
|
|
6093
|
+
```typescript
|
|
6094
|
+
public readonly spot: boolean;
|
|
6095
|
+
```
|
|
6096
|
+
|
|
6097
|
+
- *Type:* boolean
|
|
6098
|
+
- *Default:* false (true if spotMaxPrice is specified)
|
|
6099
|
+
|
|
6100
|
+
Use spot capacity.
|
|
6101
|
+
|
|
6102
|
+
---
|
|
6103
|
+
|
|
6090
6104
|
##### `spotMaxPrice`<sup>Optional</sup> <a name="spotMaxPrice" id="@cloudsnorkel/cdk-github-runners.EcsRunnerProviderProps.property.spotMaxPrice"></a>
|
|
6091
6105
|
|
|
6092
6106
|
```typescript
|
|
@@ -6094,9 +6108,8 @@ public readonly spotMaxPrice: string;
|
|
|
6094
6108
|
```
|
|
6095
6109
|
|
|
6096
6110
|
- *Type:* string
|
|
6097
|
-
- *Default:* no spot capacity
|
|
6098
6111
|
|
|
6099
|
-
|
|
6112
|
+
Maximum price for spot instances.
|
|
6100
6113
|
|
|
6101
6114
|
---
|
|
6102
6115
|
|
|
@@ -7545,7 +7558,7 @@ public readonly os: Os;
|
|
|
7545
7558
|
```
|
|
7546
7559
|
|
|
7547
7560
|
- *Type:* <a href="#@cloudsnorkel/cdk-github-runners.Os">Os</a>
|
|
7548
|
-
- *Default:* OS.
|
|
7561
|
+
- *Default:* OS.LINUX_UBUNTU
|
|
7549
7562
|
|
|
7550
7563
|
Image OS.
|
|
7551
7564
|
|
package/README.md
CHANGED
|
@@ -55,39 +55,96 @@ You can also create your own provider by implementing `IRunnerProvider`.
|
|
|
55
55
|
|
|
56
56
|
## Installation
|
|
57
57
|
|
|
58
|
-
1.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
58
|
+
1. Install and use the appropriate package
|
|
59
|
+
<details><summary>Python</summary>
|
|
60
|
+
|
|
61
|
+
### Install
|
|
62
|
+
Available on [PyPI][6].
|
|
63
|
+
```bash
|
|
64
|
+
pip install cloudsnorkel.cdk-github-runners
|
|
65
|
+
```
|
|
66
|
+
### Use
|
|
67
|
+
```python
|
|
68
|
+
from cloudsnorkel.cdk_github_runners import GitHubRunners
|
|
69
|
+
|
|
70
|
+
GitHubRunners(self, "runners")
|
|
71
|
+
```
|
|
72
|
+
</details>
|
|
73
|
+
<details><summary>TypeScript or JavaScript</summary>
|
|
74
|
+
|
|
75
|
+
### Install
|
|
76
|
+
Available on [npm][7].
|
|
77
|
+
```bash
|
|
78
|
+
npm i @cloudsnorkel/cdk-github-runners
|
|
79
|
+
```
|
|
80
|
+
### Use
|
|
81
|
+
```typescript
|
|
82
|
+
import { GitHubRunners } from '@cloudsnorkel/cdk-github-runners';
|
|
83
|
+
|
|
84
|
+
new GitHubRunners(this, "runners");
|
|
85
|
+
```
|
|
86
|
+
</details>
|
|
87
|
+
<details><summary>Java</summary>
|
|
88
|
+
|
|
89
|
+
### Install
|
|
90
|
+
Available on [Maven][8].
|
|
91
|
+
```xml
|
|
92
|
+
<dependency>
|
|
71
93
|
<groupId>com.cloudsnorkel</groupId>
|
|
72
94
|
<artifactId>cdk.github.runners</artifactId>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
95
|
+
</dependency>
|
|
96
|
+
```
|
|
97
|
+
### Use
|
|
98
|
+
```java
|
|
99
|
+
import com.cloudsnorkel.cdk.github.runners.GitHubRunners;
|
|
100
|
+
|
|
101
|
+
GitHubRunners.Builder.create(this, "runners").build();
|
|
102
|
+
```
|
|
103
|
+
</details>
|
|
104
|
+
<details><summary>Go</summary>
|
|
105
|
+
|
|
106
|
+
### Install
|
|
107
|
+
Available on [GitHub][11].
|
|
108
|
+
```bash
|
|
109
|
+
go get github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners
|
|
110
|
+
```
|
|
111
|
+
### Use
|
|
112
|
+
```go
|
|
113
|
+
import "github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners"
|
|
114
|
+
|
|
115
|
+
NewGitHubRunners(this, jsii.String("runners"))
|
|
116
|
+
```
|
|
117
|
+
</details>
|
|
118
|
+
<details><summary>.NET</summary>
|
|
119
|
+
|
|
120
|
+
### Install
|
|
121
|
+
Available on [Nuget][12].
|
|
122
|
+
```bash
|
|
123
|
+
dotnet add package CloudSnorkel.Cdk.Github.Runners
|
|
124
|
+
```
|
|
125
|
+
### Use
|
|
126
|
+
```csharp
|
|
127
|
+
using CloudSnorkel;
|
|
128
|
+
|
|
129
|
+
new GitHubRunners(this, "runners");
|
|
130
|
+
```
|
|
131
|
+
</details>
|
|
132
|
+
2. Use `GitHubRunners` construct in your code (starting with default arguments is fine)
|
|
133
|
+
3. Deploy your stack
|
|
134
|
+
4. Look for the status command output similar to `aws --region us-east-1 lambda invoke --function-name status-XYZ123 status.json`
|
|
135
|
+
```
|
|
136
|
+
✅ github-runners-test
|
|
137
|
+
|
|
138
|
+
✨ Deployment time: 260.01s
|
|
139
|
+
|
|
140
|
+
Outputs:
|
|
141
|
+
github-runners-test.runnersstatuscommand4A30F0F5 = aws --region us-east-1 lambda invoke --function-name github-runners-test-runnersstatus1A5771C0-mvttg8oPQnQS status.json
|
|
142
|
+
```
|
|
143
|
+
5. Execute the status command (you may need to specify `--profile` too) and open the resulting `status.json` file
|
|
144
|
+
6. Open the URL in `github.setup.url` from `status.json` or [manually setup GitHub](SETUP_GITHUB.md) integration as an app or with personal access token
|
|
145
|
+
7. Run status command again to confirm `github.auth.status` and `github.webhook.status` are OK
|
|
146
|
+
8. Trigger a GitHub action that has a `self-hosted` label with `runs-on: [self-hosted, linux, codebuild]` or similar
|
|
147
|
+
9. If the action is not successful, see [troubleshooting](#Troubleshooting)
|
|
91
148
|
|
|
92
149
|
[](https://youtu.be/wlyv_3V8lIw)
|
|
93
150
|
|
|
@@ -104,10 +161,10 @@ let dbSg: ec2.SecurityGroup;
|
|
|
104
161
|
let bucket: s3.Bucket;
|
|
105
162
|
|
|
106
163
|
// create a custom CodeBuild provider
|
|
107
|
-
const myProvider = new CodeBuildRunnerProvider(this, 'codebuild runner', {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
164
|
+
const myProvider = new CodeBuildRunnerProvider(this, 'codebuild runner', {
|
|
165
|
+
labels: ['my-codebuild'],
|
|
166
|
+
vpc: vpc,
|
|
167
|
+
securityGroups: [runnerSg],
|
|
111
168
|
});
|
|
112
169
|
// grant some permissions to the provider
|
|
113
170
|
bucket.grantReadWrite(myProvider);
|
|
@@ -132,9 +189,9 @@ myBuilder.addComponent(
|
|
|
132
189
|
);
|
|
133
190
|
|
|
134
191
|
const myProvider = new FargateRunnerProvider(this, 'fargate runner', {
|
|
135
|
-
|
|
192
|
+
labels: ['customized-fargate'],
|
|
136
193
|
vpc: vpc,
|
|
137
|
-
|
|
194
|
+
securityGroups: [runnerSg],
|
|
138
195
|
imageBuilder: myBuilder,
|
|
139
196
|
});
|
|
140
197
|
|
|
@@ -160,31 +217,31 @@ Windows images can also be customized the same way.
|
|
|
160
217
|
|
|
161
218
|
```typescript
|
|
162
219
|
const myWindowsBuilder = FargateRunnerProvider.imageBuilder(this, 'Windows image builder', {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
220
|
+
architecture: Architecture.X86_64,
|
|
221
|
+
os: Os.WINDOWS,
|
|
222
|
+
runnerVersion: RunnerVersion.specific('2.291.0'),
|
|
223
|
+
rebuildInterval: Duration.days(14),
|
|
167
224
|
});
|
|
168
225
|
myWindowsBuilder.addComponent(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
226
|
+
RunnerImageComponent.custom({
|
|
227
|
+
name: 'Ninja',
|
|
228
|
+
commands: [
|
|
229
|
+
'Invoke-WebRequest -UseBasicParsing -Uri "https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip" -OutFile ninja.zip',
|
|
230
|
+
'Expand-Archive ninja.zip -DestinationPath C:\\actions',
|
|
231
|
+
'del ninja.zip',
|
|
232
|
+
],
|
|
233
|
+
})
|
|
177
234
|
);
|
|
178
235
|
|
|
179
236
|
const myProvider = new FargateRunnerProvider(this, 'fargate runner', {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
237
|
+
labels: ['customized-windows-fargate'],
|
|
238
|
+
vpc: vpc,
|
|
239
|
+
securityGroups: [runnerSg],
|
|
240
|
+
imageBuidler: myWindowsBuilder,
|
|
184
241
|
});
|
|
185
242
|
|
|
186
243
|
new GitHubRunners(this, 'runners', {
|
|
187
|
-
|
|
244
|
+
providers: [myProvider],
|
|
188
245
|
});
|
|
189
246
|
```
|
|
190
247
|
|
|
@@ -192,15 +249,15 @@ The runner OS and architecture is determined by the image it is set to use. For
|
|
|
192
249
|
|
|
193
250
|
```typescript
|
|
194
251
|
new GitHubRunners(this, 'runners', {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
252
|
+
providers: [
|
|
253
|
+
new FargateRunnerProvider(this, 'fargate runner', {
|
|
254
|
+
labels: ['arm64', 'fargate'],
|
|
255
|
+
imageBuidler: FargateRunnerProvider.imageBuilder(this, 'image builder', {
|
|
256
|
+
architecture: Architecture.ARM64,
|
|
257
|
+
os: Os.LINUX_UBUNTU,
|
|
258
|
+
}),
|
|
201
259
|
}),
|
|
202
|
-
|
|
203
|
-
],
|
|
260
|
+
],
|
|
204
261
|
});
|
|
205
262
|
```
|
|
206
263
|
|
|
@@ -247,7 +304,7 @@ Other useful metrics to track:
|
|
|
247
304
|
[5]: https://github.com/actions/runner
|
|
248
305
|
[6]: https://pypi.org/project/cloudsnorkel.cdk-github-runners
|
|
249
306
|
[7]: https://www.npmjs.com/package/@cloudsnorkel/cdk-github-runners
|
|
250
|
-
[8]: https://
|
|
307
|
+
[8]: https://central.sonatype.com/artifact/com.cloudsnorkel/cdk.github.runners/
|
|
251
308
|
[9]: https://docs.github.com/en/developers/apps/getting-started-with-apps/about-apps
|
|
252
309
|
[10]: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
|
|
253
310
|
[11]: https://pkg.go.dev/github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners
|
|
@@ -10322,7 +10322,7 @@ var require_semver = __commonJS({
|
|
|
10322
10322
|
version = version.version;
|
|
10323
10323
|
}
|
|
10324
10324
|
} else if (typeof version !== "string") {
|
|
10325
|
-
throw new TypeError(`Invalid Version: ${version}`);
|
|
10325
|
+
throw new TypeError(`Invalid Version: ${require("util").inspect(version)}`);
|
|
10326
10326
|
}
|
|
10327
10327
|
if (version.length > MAX_LENGTH) {
|
|
10328
10328
|
throw new TypeError(
|
|
@@ -10495,9 +10495,13 @@ var require_semver = __commonJS({
|
|
|
10495
10495
|
}
|
|
10496
10496
|
this.prerelease = [];
|
|
10497
10497
|
break;
|
|
10498
|
-
case "pre":
|
|
10498
|
+
case "pre": {
|
|
10499
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
10500
|
+
if (!identifier && identifierBase === false) {
|
|
10501
|
+
throw new Error("invalid increment argument: identifier is empty");
|
|
10502
|
+
}
|
|
10499
10503
|
if (this.prerelease.length === 0) {
|
|
10500
|
-
this.prerelease = [
|
|
10504
|
+
this.prerelease = [base];
|
|
10501
10505
|
} else {
|
|
10502
10506
|
let i = this.prerelease.length;
|
|
10503
10507
|
while (--i >= 0) {
|
|
@@ -10507,20 +10511,27 @@ var require_semver = __commonJS({
|
|
|
10507
10511
|
}
|
|
10508
10512
|
}
|
|
10509
10513
|
if (i === -1) {
|
|
10510
|
-
this.prerelease.
|
|
10514
|
+
if (identifier === this.prerelease.join(".") && identifierBase === false) {
|
|
10515
|
+
throw new Error("invalid increment argument: identifier already exists");
|
|
10516
|
+
}
|
|
10517
|
+
this.prerelease.push(base);
|
|
10511
10518
|
}
|
|
10512
10519
|
}
|
|
10513
10520
|
if (identifier) {
|
|
10514
|
-
|
|
10521
|
+
let prerelease = [identifier, base];
|
|
10522
|
+
if (identifierBase === false) {
|
|
10523
|
+
prerelease = [identifier];
|
|
10524
|
+
}
|
|
10515
10525
|
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
10516
10526
|
if (isNaN(this.prerelease[1])) {
|
|
10517
|
-
this.prerelease =
|
|
10527
|
+
this.prerelease = prerelease;
|
|
10518
10528
|
}
|
|
10519
10529
|
} else {
|
|
10520
|
-
this.prerelease =
|
|
10530
|
+
this.prerelease = prerelease;
|
|
10521
10531
|
}
|
|
10522
10532
|
}
|
|
10523
10533
|
break;
|
|
10534
|
+
}
|
|
10524
10535
|
default:
|
|
10525
10536
|
throw new Error(`invalid increment argument: ${release}`);
|
|
10526
10537
|
}
|
|
@@ -10536,22 +10547,18 @@ var require_semver = __commonJS({
|
|
|
10536
10547
|
// node_modules/semver/functions/parse.js
|
|
10537
10548
|
var require_parse = __commonJS({
|
|
10538
10549
|
"node_modules/semver/functions/parse.js"(exports2, module2) {
|
|
10539
|
-
var { MAX_LENGTH } = require_constants();
|
|
10540
10550
|
var SemVer = require_semver();
|
|
10541
|
-
var parse = (version, options) => {
|
|
10551
|
+
var parse = (version, options, throwErrors = false) => {
|
|
10542
10552
|
if (version instanceof SemVer) {
|
|
10543
10553
|
return version;
|
|
10544
10554
|
}
|
|
10545
|
-
if (typeof version !== "string") {
|
|
10546
|
-
return null;
|
|
10547
|
-
}
|
|
10548
|
-
if (version.length > MAX_LENGTH) {
|
|
10549
|
-
return null;
|
|
10550
|
-
}
|
|
10551
10555
|
try {
|
|
10552
10556
|
return new SemVer(version, options);
|
|
10553
10557
|
} catch (er) {
|
|
10554
|
-
|
|
10558
|
+
if (!throwErrors) {
|
|
10559
|
+
return null;
|
|
10560
|
+
}
|
|
10561
|
+
throw er;
|
|
10555
10562
|
}
|
|
10556
10563
|
};
|
|
10557
10564
|
module2.exports = parse;
|
|
@@ -10605,60 +10612,41 @@ var require_inc = __commonJS({
|
|
|
10605
10612
|
}
|
|
10606
10613
|
});
|
|
10607
10614
|
|
|
10608
|
-
// node_modules/semver/functions/compare.js
|
|
10609
|
-
var require_compare = __commonJS({
|
|
10610
|
-
"node_modules/semver/functions/compare.js"(exports2, module2) {
|
|
10611
|
-
var SemVer = require_semver();
|
|
10612
|
-
var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
10613
|
-
module2.exports = compare;
|
|
10614
|
-
}
|
|
10615
|
-
});
|
|
10616
|
-
|
|
10617
|
-
// node_modules/semver/functions/eq.js
|
|
10618
|
-
var require_eq = __commonJS({
|
|
10619
|
-
"node_modules/semver/functions/eq.js"(exports2, module2) {
|
|
10620
|
-
var compare = require_compare();
|
|
10621
|
-
var eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
10622
|
-
module2.exports = eq;
|
|
10623
|
-
}
|
|
10624
|
-
});
|
|
10625
|
-
|
|
10626
10615
|
// node_modules/semver/functions/diff.js
|
|
10627
10616
|
var require_diff = __commonJS({
|
|
10628
10617
|
"node_modules/semver/functions/diff.js"(exports2, module2) {
|
|
10629
10618
|
var parse = require_parse();
|
|
10630
|
-
var eq = require_eq();
|
|
10631
10619
|
var diff = (version1, version2) => {
|
|
10632
|
-
const v1 = parse(version1);
|
|
10633
|
-
const v2 = parse(version2);
|
|
10634
|
-
|
|
10620
|
+
const v1 = parse(version1, null, true);
|
|
10621
|
+
const v2 = parse(version2, null, true);
|
|
10622
|
+
const comparison = v1.compare(v2);
|
|
10623
|
+
if (comparison === 0) {
|
|
10635
10624
|
return null;
|
|
10636
|
-
} else {
|
|
10637
|
-
const hasPre = v1.prerelease.length || v2.prerelease.length;
|
|
10638
|
-
const prefix = hasPre ? "pre" : "";
|
|
10639
|
-
const defaultResult = hasPre ? "prerelease" : "";
|
|
10640
|
-
if (v1.major !== v2.major) {
|
|
10641
|
-
return prefix + "major";
|
|
10642
|
-
}
|
|
10643
|
-
if (v1.minor !== v2.minor) {
|
|
10644
|
-
return prefix + "minor";
|
|
10645
|
-
}
|
|
10646
|
-
if (v1.patch !== v2.patch) {
|
|
10647
|
-
return prefix + "patch";
|
|
10648
|
-
}
|
|
10649
|
-
if (!v1.prerelease.length || !v2.prerelease.length) {
|
|
10650
|
-
if (v1.patch) {
|
|
10651
|
-
return "patch";
|
|
10652
|
-
}
|
|
10653
|
-
if (v1.minor) {
|
|
10654
|
-
return "minor";
|
|
10655
|
-
}
|
|
10656
|
-
if (v1.major) {
|
|
10657
|
-
return "major";
|
|
10658
|
-
}
|
|
10659
|
-
}
|
|
10660
|
-
return defaultResult;
|
|
10661
10625
|
}
|
|
10626
|
+
const v1Higher = comparison > 0;
|
|
10627
|
+
const highVersion = v1Higher ? v1 : v2;
|
|
10628
|
+
const lowVersion = v1Higher ? v2 : v1;
|
|
10629
|
+
const highHasPre = !!highVersion.prerelease.length;
|
|
10630
|
+
const prefix = highHasPre ? "pre" : "";
|
|
10631
|
+
if (v1.major !== v2.major) {
|
|
10632
|
+
return prefix + "major";
|
|
10633
|
+
}
|
|
10634
|
+
if (v1.minor !== v2.minor) {
|
|
10635
|
+
return prefix + "minor";
|
|
10636
|
+
}
|
|
10637
|
+
if (v1.patch !== v2.patch) {
|
|
10638
|
+
return prefix + "patch";
|
|
10639
|
+
}
|
|
10640
|
+
if (highHasPre) {
|
|
10641
|
+
return "prerelease";
|
|
10642
|
+
}
|
|
10643
|
+
if (lowVersion.patch) {
|
|
10644
|
+
return "patch";
|
|
10645
|
+
}
|
|
10646
|
+
if (lowVersion.minor) {
|
|
10647
|
+
return "minor";
|
|
10648
|
+
}
|
|
10649
|
+
return "major";
|
|
10662
10650
|
};
|
|
10663
10651
|
module2.exports = diff;
|
|
10664
10652
|
}
|
|
@@ -10703,6 +10691,15 @@ var require_prerelease = __commonJS({
|
|
|
10703
10691
|
}
|
|
10704
10692
|
});
|
|
10705
10693
|
|
|
10694
|
+
// node_modules/semver/functions/compare.js
|
|
10695
|
+
var require_compare = __commonJS({
|
|
10696
|
+
"node_modules/semver/functions/compare.js"(exports2, module2) {
|
|
10697
|
+
var SemVer = require_semver();
|
|
10698
|
+
var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
10699
|
+
module2.exports = compare;
|
|
10700
|
+
}
|
|
10701
|
+
});
|
|
10702
|
+
|
|
10706
10703
|
// node_modules/semver/functions/rcompare.js
|
|
10707
10704
|
var require_rcompare = __commonJS({
|
|
10708
10705
|
"node_modules/semver/functions/rcompare.js"(exports2, module2) {
|
|
@@ -10770,6 +10767,15 @@ var require_lt = __commonJS({
|
|
|
10770
10767
|
}
|
|
10771
10768
|
});
|
|
10772
10769
|
|
|
10770
|
+
// node_modules/semver/functions/eq.js
|
|
10771
|
+
var require_eq = __commonJS({
|
|
10772
|
+
"node_modules/semver/functions/eq.js"(exports2, module2) {
|
|
10773
|
+
var compare = require_compare();
|
|
10774
|
+
var eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
10775
|
+
module2.exports = eq;
|
|
10776
|
+
}
|
|
10777
|
+
});
|
|
10778
|
+
|
|
10773
10779
|
// node_modules/semver/functions/neq.js
|
|
10774
10780
|
var require_neq = __commonJS({
|
|
10775
10781
|
"node_modules/semver/functions/neq.js"(exports2, module2) {
|