Compare commits
58
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eba86ac8e5 | ||
|
|
7bc21fcdc7 | ||
|
|
79bca752a7 | ||
|
|
0e5e41f460 | ||
|
|
c41d55c25b | ||
|
|
eddbc53172 | ||
|
|
2b28ba98d2 | ||
|
|
9878b316bc | ||
|
|
3bb968c87d | ||
|
|
1f54c5a9d9 | ||
|
|
fd6b46e1b1 | ||
|
|
07b12ceeb9 | ||
|
|
a5dd6dad3a | ||
|
|
cb8a95b3d3 | ||
|
|
24b34fe9df | ||
|
|
19e3963acc | ||
|
|
2659253cfb | ||
|
|
f8a41a9af4 | ||
|
|
078c86814c | ||
|
|
c8c7d121e6 | ||
|
|
1c30a57287 | ||
|
|
3e6be5fff1 | ||
|
|
b81b9ee522 | ||
|
|
ba4a25e3f2 | ||
|
|
4a1378d6c7 | ||
|
|
af5f0e30b5 | ||
|
|
6fd45e865f | ||
|
|
272af21052 | ||
|
|
738cefc802 | ||
|
|
81e1ca4dd1 | ||
|
|
a2c7303d62 | ||
|
|
70996e0181 | ||
|
|
40dbf5633f | ||
|
|
3159c977fc | ||
|
|
41e7027b2d | ||
|
|
e4229f9c68 | ||
|
|
9514e20e7b | ||
|
|
5fcdc27e75 | ||
|
|
1260d3a971 | ||
|
|
9ebabe1266 | ||
|
|
e39ae90ae2 | ||
|
|
39d2a05014 | ||
|
|
45eb11ae9c | ||
|
|
71e805d90c | ||
|
|
9f660ff885 | ||
|
|
01e85df88a | ||
|
|
caa0d50d52 | ||
|
|
452e1fa4b9 | ||
|
|
94e773d915 | ||
|
|
18730e824f | ||
|
|
4bf763f264 | ||
|
|
d259350c3e | ||
|
|
286bd67de5 | ||
|
|
95551a0df8 | ||
|
|
4e80bab563 | ||
|
|
5145268539 | ||
|
|
dd352f1044 | ||
|
|
39410186df |
@@ -1,2 +1,4 @@
|
|||||||
# style: prettier (#2670)
|
# style: prettier (#2670)
|
||||||
b06c9bbe4c6be121c5561b356d8c465c1cadffba
|
b06c9bbe4c6be121c5561b356d8c465c1cadffba
|
||||||
|
# style: upgraded prettier to v3 (#2863)
|
||||||
|
272af210523804de782b3076f05e56bcb4aeeb8f
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ jobs:
|
|||||||
name: release
|
name: release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
|
||||||
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
|
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3
|
||||||
with:
|
with:
|
||||||
cache: npm
|
cache: npm
|
||||||
node-version: lts/*
|
node-version: lts/*
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
name: OpenSSF Scorecard
|
||||||
|
"on":
|
||||||
|
schedule:
|
||||||
|
- cron: 31 2 * * 1
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
permissions: read-all
|
||||||
|
jobs:
|
||||||
|
analysis:
|
||||||
|
name: Scorecard analysis
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
security-events: write
|
||||||
|
id-token: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: Run analysis
|
||||||
|
uses: ossf/scorecard-action@08b4669551908b1024bb425080c797723083c031 # v2.2.0
|
||||||
|
with:
|
||||||
|
results_file: results.sarif
|
||||||
|
results_format: sarif
|
||||||
|
publish_results: true
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||||
|
with:
|
||||||
|
name: SARIF file
|
||||||
|
path: results.sarif
|
||||||
|
retention-days: 5
|
||||||
|
- name: Upload to code-scanning
|
||||||
|
uses: github/codeql-action/upload-sarif@a09933a12a80f87b87005513f0abb1494c27a716 # v2.21.4
|
||||||
|
with:
|
||||||
|
sarif_file: results.sarif
|
||||||
@@ -27,11 +27,11 @@ jobs:
|
|||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
|
||||||
- run: git config --global user.name github-actions
|
- run: git config --global user.name github-actions
|
||||||
- run: git config --global user.email github-actions@github.com
|
- run: git config --global user.email github-actions@github.com
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
|
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
cache: npm
|
cache: npm
|
||||||
@@ -46,8 +46,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: test_matrix
|
needs: test_matrix
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
|
||||||
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
|
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3
|
||||||
with:
|
with:
|
||||||
node-version: lts/*
|
node-version: lts/*
|
||||||
cache: npm
|
cache: npm
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|||||||
copies of the Software, and to permit persons to whom the Software is
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
furnished to do so, subject to the following conditions:
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be included in
|
||||||
copies or substantial portions of the Software.
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
|||||||
@@ -7,6 +7,9 @@
|
|||||||
<a href="https://github.com/semantic-release/semantic-release/actions?query=workflow%3ATest+branch%3Amaster">
|
<a href="https://github.com/semantic-release/semantic-release/actions?query=workflow%3ATest+branch%3Amaster">
|
||||||
<img alt="Build states" src="https://github.com/semantic-release/semantic-release/workflows/Test/badge.svg">
|
<img alt="Build states" src="https://github.com/semantic-release/semantic-release/workflows/Test/badge.svg">
|
||||||
</a>
|
</a>
|
||||||
|
<a href="https://securityscorecards.dev/viewer/?uri=github.com/semantic-release/semantic-release">
|
||||||
|
<img alt="OpenSSF Scorecard" src="https://api.securityscorecards.dev/projects/github.com/semantic-release/semantic-release/badge">
|
||||||
|
</a>
|
||||||
<a href="#badge">
|
<a href="#badge">
|
||||||
<img alt="semantic-release: angular" src="https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release">
|
<img alt="semantic-release: angular" src="https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release">
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -107,7 +107,7 @@
|
|||||||
- `verifyConditions`: Verify the presence and the validity of the authentication and the assets option configuration.
|
- `verifyConditions`: Verify the presence and the validity of the authentication and the assets option configuration.
|
||||||
- `publish`: Publish a Gitea release, optionally uploading file assets.
|
- `publish`: Publish a Gitea release, optionally uploading file assets.
|
||||||
- `addChannel`: Update a Gitea release's pre-release field.
|
- `addChannel`: Update a Gitea release's pre-release field.
|
||||||
- [@google/semantic-release-replace-plugin](https://github.com/google/semantic-release-replace-plugin)
|
- [semantic-release-replace-plugin](https://github.com/jpoehnelt/semantic-release-replace-plugin)
|
||||||
- `prepare`: Replace version strings in files using regex and glob.
|
- `prepare`: Replace version strings in files using regex and glob.
|
||||||
- [semantic-release-rubygem](https://github.com/Gusto/semantic-release-rubygem)
|
- [semantic-release-rubygem](https://github.com/Gusto/semantic-release-rubygem)
|
||||||
- `verifyConditions`: Locate and validate a `.gemspec` file, locate and validate a `lib/**/version.rb` file, verify the presence of the `GEM_HOST_API_KEY` environment variable, and create a credentials file with the API key.
|
- `verifyConditions`: Locate and validate a `.gemspec` file, locate and validate a `lib/**/version.rb` file, verify the presence of the `GEM_HOST_API_KEY` environment variable, and create a credentials file with the API key.
|
||||||
|
|||||||
@@ -30,7 +30,11 @@ export default ({ branch, options: { tagFormat } }, { before } = {}) => {
|
|||||||
const [{ version, gitTag, channels } = {}] = branch.tags
|
const [{ version, gitTag, channels } = {}] = branch.tags
|
||||||
.filter(
|
.filter(
|
||||||
(tag) =>
|
(tag) =>
|
||||||
((branch.type === "prerelease" && tag.channels.some((channel) => isSameChannel(branch.channel, channel))) ||
|
((branch.type === "prerelease" &&
|
||||||
|
tag.channels.some((channel) => isSameChannel(branch.channel, channel)) &&
|
||||||
|
semver
|
||||||
|
.parse(tag.version)
|
||||||
|
.prerelease.includes(branch.prerelease === true ? branch.name : branch.prerelease)) ||
|
||||||
!semver.prerelease(tag.version)) &&
|
!semver.prerelease(tag.version)) &&
|
||||||
(isUndefined(before) || semver.lt(tag.version, before))
|
(isUndefined(before) || semver.lt(tag.version, before))
|
||||||
)
|
)
|
||||||
|
|||||||
Generated
+732
-7779
File diff suppressed because it is too large
Load Diff
+14
-14
@@ -26,29 +26,29 @@
|
|||||||
"Matt Travi <npm@travi.org> (https://matt.travi.org/)"
|
"Matt Travi <npm@travi.org> (https://matt.travi.org/)"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@semantic-release/commit-analyzer": "^10.0.0-beta.1",
|
"@semantic-release/commit-analyzer": "^10.0.0",
|
||||||
"@semantic-release/error": "^3.0.0",
|
"@semantic-release/error": "^4.0.0",
|
||||||
"@semantic-release/github": "9.0.0-beta.2",
|
"@semantic-release/github": "^9.0.0",
|
||||||
"@semantic-release/npm": "^10.0.2",
|
"@semantic-release/npm": "^10.0.2",
|
||||||
"@semantic-release/release-notes-generator": "^11.0.0",
|
"@semantic-release/release-notes-generator": "^11.0.0",
|
||||||
"aggregate-error": "^4.0.1",
|
"aggregate-error": "^4.0.1",
|
||||||
"cosmiconfig": "^8.0.0",
|
"cosmiconfig": "^8.0.0",
|
||||||
"debug": "^4.0.0",
|
"debug": "^4.0.0",
|
||||||
"env-ci": "^9.0.0",
|
"env-ci": "^9.0.0",
|
||||||
"execa": "^7.0.0",
|
"execa": "^8.0.0",
|
||||||
"figures": "^5.0.0",
|
"figures": "^5.0.0",
|
||||||
"find-versions": "^5.1.0",
|
"find-versions": "^5.1.0",
|
||||||
"get-stream": "^6.0.0",
|
"get-stream": "^6.0.0",
|
||||||
"git-log-parser": "^1.2.0",
|
"git-log-parser": "^1.2.0",
|
||||||
"hook-std": "^3.0.0",
|
"hook-std": "^3.0.0",
|
||||||
"hosted-git-info": "^6.0.0",
|
"hosted-git-info": "^7.0.0",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"marked": "^4.1.0",
|
"marked": "^5.0.0",
|
||||||
"marked-terminal": "^5.1.1",
|
"marked-terminal": "^5.1.1",
|
||||||
"micromatch": "^4.0.2",
|
"micromatch": "^4.0.2",
|
||||||
"p-each-series": "^3.0.0",
|
"p-each-series": "^3.0.0",
|
||||||
"p-reduce": "^3.0.0",
|
"p-reduce": "^3.0.0",
|
||||||
"read-pkg-up": "^9.1.0",
|
"read-pkg-up": "^10.0.0",
|
||||||
"resolve-from": "^5.0.0",
|
"resolve-from": "^5.0.0",
|
||||||
"semver": "^7.3.2",
|
"semver": "^7.3.2",
|
||||||
"semver-diff": "^4.0.0",
|
"semver-diff": "^4.0.0",
|
||||||
@@ -56,22 +56,22 @@
|
|||||||
"yargs": "^17.5.1"
|
"yargs": "^17.5.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"ava": "5.2.0",
|
"ava": "5.3.1",
|
||||||
"c8": "7.14.0",
|
"c8": "8.0.1",
|
||||||
"clear-module": "4.1.2",
|
"clear-module": "4.1.2",
|
||||||
"codecov": "3.8.3",
|
"codecov": "3.8.3",
|
||||||
"dockerode": "3.3.5",
|
"dockerode": "3.3.5",
|
||||||
"file-url": "4.0.0",
|
"file-url": "4.0.0",
|
||||||
"fs-extra": "11.1.1",
|
"fs-extra": "11.1.1",
|
||||||
"got": "12.6.0",
|
"got": "13.0.0",
|
||||||
"js-yaml": "4.1.0",
|
"js-yaml": "4.1.0",
|
||||||
"mockserver-client": "5.15.0",
|
"mockserver-client": "5.15.0",
|
||||||
"nock": "13.3.1",
|
"nock": "13.3.3",
|
||||||
"p-retry": "5.1.2",
|
"p-retry": "5.1.2",
|
||||||
"prettier": "2.8.8",
|
"prettier": "3.0.2",
|
||||||
"sinon": "15.1.0",
|
"sinon": "15.2.0",
|
||||||
"stream-buffers": "3.0.2",
|
"stream-buffers": "3.0.2",
|
||||||
"tempy": "3.0.0",
|
"tempy": "3.1.0",
|
||||||
"testdouble": "3.18.0"
|
"testdouble": "3.18.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
@@ -43,6 +43,43 @@ test("Get the highest prerelease valid tag, ignoring other tags from other prere
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("Get the correct prerelease tag, when other prereleases share the same git HEAD", (t) => {
|
||||||
|
const testConfig = {
|
||||||
|
branch: {
|
||||||
|
name: "alpha",
|
||||||
|
prerelease: "alpha",
|
||||||
|
channel: "alpha",
|
||||||
|
tags: [
|
||||||
|
{ version: "1.0.0-beta.1", gitTag: "v1.0.0-beta.1", gitHead: "v1.0.0-beta.1", channels: ["beta"] },
|
||||||
|
{ version: "1.0.0-beta.2", gitTag: "v1.0.0-beta.2", gitHead: "v1.0.0-alpha.1", channels: ["alpha", "beta"] },
|
||||||
|
{ version: "1.0.0-alpha.1", gitTag: "v1.0.0-alpha.1", gitHead: "v1.0.0-alpha.1", channels: ["alpha", "beta"] },
|
||||||
|
],
|
||||||
|
type: "prerelease",
|
||||||
|
},
|
||||||
|
options: { tagFormat: `v\${version}`, debug: true },
|
||||||
|
};
|
||||||
|
const firstResult = getLastRelease(testConfig);
|
||||||
|
|
||||||
|
t.deepEqual(firstResult, {
|
||||||
|
version: "1.0.0-alpha.1",
|
||||||
|
gitTag: "v1.0.0-alpha.1",
|
||||||
|
name: "v1.0.0-alpha.1",
|
||||||
|
gitHead: "v1.0.0-alpha.1",
|
||||||
|
channels: ["alpha", "beta"],
|
||||||
|
});
|
||||||
|
|
||||||
|
testConfig.branch.prerelease = true;
|
||||||
|
const secondResult = getLastRelease(testConfig);
|
||||||
|
|
||||||
|
t.deepEqual(secondResult, {
|
||||||
|
version: "1.0.0-alpha.1",
|
||||||
|
gitTag: "v1.0.0-alpha.1",
|
||||||
|
name: "v1.0.0-alpha.1",
|
||||||
|
gitHead: "v1.0.0-alpha.1",
|
||||||
|
channels: ["alpha", "beta"],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
test("Return empty object if no valid tag is found", (t) => {
|
test("Return empty object if no valid tag is found", (t) => {
|
||||||
const result = getLastRelease({
|
const result = getLastRelease({
|
||||||
branch: {
|
branch: {
|
||||||
|
|||||||
@@ -275,3 +275,24 @@ test("Increase version for release on prerelease branch when there is no regular
|
|||||||
"1.0.0-beta.2"
|
"1.0.0-beta.2"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("Increase patch when previous version shares HEAD with other releases", (t) => {
|
||||||
|
t.is(
|
||||||
|
getNextVersion({
|
||||||
|
branch: {
|
||||||
|
name: "alpha",
|
||||||
|
type: "prerelease",
|
||||||
|
prerelease: "alpha",
|
||||||
|
tags: [
|
||||||
|
{ gitTag: "v1.0.0-beta.1", version: "1.0.0-beta.1", channels: ["beta"] },
|
||||||
|
{ gitTag: "v1.0.0-beta.2", version: "1.0.0-beta.2", channels: ["alpha", "beta"] },
|
||||||
|
{ gitTag: "v1.0.0-alpha.1", version: "1.0.0-alpha.1", channels: ["alpha", "beta"] },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
nextRelease: { type: "patch", channel: "alpha" },
|
||||||
|
lastRelease: { version: "v1.0.0-alpha.1", channels: ["alpha", "beta"] },
|
||||||
|
logger: t.context.logger,
|
||||||
|
}),
|
||||||
|
"1.0.0-alpha.2"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|||||||
@@ -90,9 +90,7 @@ export async function gitCommits(messages, execaOptions) {
|
|||||||
await pEachSeries(
|
await pEachSeries(
|
||||||
messages,
|
messages,
|
||||||
async (message) =>
|
async (message) =>
|
||||||
(
|
(await execa("git", ["commit", "-m", message, "--allow-empty", "--no-gpg-sign"], execaOptions)).stdout
|
||||||
await execa("git", ["commit", "-m", message, "--allow-empty", "--no-gpg-sign"], execaOptions)
|
|
||||||
).stdout
|
|
||||||
);
|
);
|
||||||
return (await gitGetCommits(undefined, execaOptions)).slice(0, messages.length);
|
return (await gitGetCommits(undefined, execaOptions)).slice(0, messages.length);
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-4
@@ -1,5 +1,4 @@
|
|||||||
import Docker from "dockerode";
|
import Docker from "dockerode";
|
||||||
import getStream from "get-stream";
|
|
||||||
import pRetry from "p-retry";
|
import pRetry from "p-retry";
|
||||||
import { gitShallowClone, initBareRepo } from "./git-utils.js";
|
import { gitShallowClone, initBareRepo } from "./git-utils.js";
|
||||||
|
|
||||||
@@ -15,11 +14,20 @@ let container;
|
|||||||
export const gitCredential = `${GIT_USERNAME}:${GIT_PASSWORD}`;
|
export const gitCredential = `${GIT_USERNAME}:${GIT_PASSWORD}`;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Download the `gitbox` Docker image, create a new container and start it.
|
* Download the `gitbox` Docker image
|
||||||
|
*/
|
||||||
|
export function pull() {
|
||||||
|
return docker.pull(IMAGE).then((stream) => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
docker.modem.followProgress(stream, (err, res) => (err ? reject(err) : resolve(res)));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a new container and start it.
|
||||||
*/
|
*/
|
||||||
export async function start() {
|
export async function start() {
|
||||||
await getStream(await docker.pull(IMAGE));
|
|
||||||
|
|
||||||
container = await docker.createContainer({
|
container = await docker.createContainer({
|
||||||
Tty: true,
|
Tty: true,
|
||||||
Image: IMAGE,
|
Image: IMAGE,
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import Docker from "dockerode";
|
import Docker from "dockerode";
|
||||||
import getStream from "get-stream";
|
|
||||||
import got from "got";
|
import got from "got";
|
||||||
import pRetry from "p-retry";
|
import pRetry from "p-retry";
|
||||||
import { mockServerClient } from "mockserver-client";
|
import { mockServerClient } from "mockserver-client";
|
||||||
@@ -11,11 +10,20 @@ const docker = new Docker();
|
|||||||
let container;
|
let container;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Download the `mockserver` Docker image, create a new container and start it.
|
* Download the `mockserver` Docker image,
|
||||||
|
*/
|
||||||
|
export function pull() {
|
||||||
|
return docker.pull(IMAGE).then((stream) => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
docker.modem.followProgress(stream, (err, res) => (err ? reject(err) : resolve(res)));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a new container and start it.
|
||||||
*/
|
*/
|
||||||
export async function start() {
|
export async function start() {
|
||||||
await getStream(await docker.pull(IMAGE));
|
|
||||||
|
|
||||||
container = await docker.createContainer({
|
container = await docker.createContainer({
|
||||||
Tty: true,
|
Tty: true,
|
||||||
Image: IMAGE,
|
Image: IMAGE,
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import path, { dirname } from "node:path";
|
|||||||
import { fileURLToPath } from "node:url";
|
import { fileURLToPath } from "node:url";
|
||||||
import { setTimeout } from "node:timers/promises";
|
import { setTimeout } from "node:timers/promises";
|
||||||
import Docker from "dockerode";
|
import Docker from "dockerode";
|
||||||
import getStream from "get-stream";
|
|
||||||
import got from "got";
|
import got from "got";
|
||||||
import pRetry from "p-retry";
|
import pRetry from "p-retry";
|
||||||
|
|
||||||
@@ -17,11 +16,20 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
|
|||||||
let container, npmToken;
|
let container, npmToken;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Download the `npm-registry-docker` Docker image, create a new container and start it.
|
* Download the `npm-registry-docker` Docker image
|
||||||
|
*/
|
||||||
|
export function pull() {
|
||||||
|
return docker.pull(IMAGE).then((stream) => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
docker.modem.followProgress(stream, (err, res) => (err ? reject(err) : resolve(res)));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a new container and start it.
|
||||||
*/
|
*/
|
||||||
export async function start() {
|
export async function start() {
|
||||||
await getStream(await docker.pull(IMAGE));
|
|
||||||
|
|
||||||
container = await docker.createContainer({
|
container = await docker.createContainer({
|
||||||
Tty: true,
|
Tty: true,
|
||||||
Image: IMAGE,
|
Image: IMAGE,
|
||||||
|
|||||||
+13
-4
@@ -1853,10 +1853,19 @@ test.serial("Throw an Error if plugin returns an unexpected value", async (t) =>
|
|||||||
await td.replaceEsm("../lib/get-logger.js", null, () => t.context.logger);
|
await td.replaceEsm("../lib/get-logger.js", null, () => t.context.logger);
|
||||||
await td.replaceEsm("env-ci", null, () => ({ isCi: true, branch: "master", isPr: false }));
|
await td.replaceEsm("env-ci", null, () => ({ isCi: true, branch: "master", isPr: false }));
|
||||||
const semanticRelease = (await import("../index.js")).default;
|
const semanticRelease = (await import("../index.js")).default;
|
||||||
const error = await t.throwsAsync(
|
|
||||||
semanticRelease(options, { cwd, env: {}, stdout: new WritableStreamBuffer(), stderr: new WritableStreamBuffer() }),
|
let error;
|
||||||
{ instanceOf: SemanticReleaseError }
|
try {
|
||||||
);
|
await semanticRelease(options, {
|
||||||
|
cwd,
|
||||||
|
env: {},
|
||||||
|
stdout: new WritableStreamBuffer(),
|
||||||
|
stderr: new WritableStreamBuffer(),
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
error = e;
|
||||||
|
}
|
||||||
|
t.is(error.code, "EANALYZECOMMITSOUTPUT");
|
||||||
t.regex(error.details, /string/);
|
t.regex(error.details, /string/);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ const pluginLogEnv = path.resolve("./test/fixtures/plugin-log-env");
|
|||||||
const pluginEsmNamedExports = path.resolve("./test/fixtures/plugin-esm-named-exports");
|
const pluginEsmNamedExports = path.resolve("./test/fixtures/plugin-esm-named-exports");
|
||||||
|
|
||||||
test.before(async () => {
|
test.before(async () => {
|
||||||
|
await Promise.all([gitbox.pull(), npmRegistry.pull(), mockServer.pull()]);
|
||||||
await Promise.all([gitbox.start(), npmRegistry.start(), mockServer.start()]);
|
await Promise.all([gitbox.start(), npmRegistry.start(), mockServer.start()]);
|
||||||
|
|
||||||
env = {
|
env = {
|
||||||
|
|||||||
Reference in New Issue
Block a user