Compare commits
47
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07a79ea7e9 | ||
|
|
0d92579e13 | ||
|
|
cb6613e2ee | ||
|
|
9e10e44fed | ||
|
|
d3c1338eac | ||
|
|
01cb041e1d | ||
|
|
4c95c97d8f | ||
|
|
5e08c4d95a | ||
|
|
c84d5d39e5 | ||
|
|
c21a1ac793 | ||
|
|
915f36cda7 | ||
|
|
eba86ac8e5 | ||
|
|
7bc21fcdc7 | ||
|
|
79bca752a7 | ||
|
|
0e5e41f460 | ||
|
|
c41d55c25b | ||
|
|
eddbc53172 | ||
|
|
2b28ba98d2 | ||
|
|
9878b316bc | ||
|
|
e40eecdce0 | ||
|
|
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 |
@@ -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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
|
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # 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/*
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ jobs:
|
|||||||
id-token: write
|
id-token: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
|
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Run analysis
|
- name: Run analysis
|
||||||
@@ -25,12 +25,12 @@ jobs:
|
|||||||
results_format: sarif
|
results_format: sarif
|
||||||
publish_results: true
|
publish_results: true
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||||
with:
|
with:
|
||||||
name: SARIF file
|
name: SARIF file
|
||||||
path: results.sarif
|
path: results.sarif
|
||||||
retention-days: 5
|
retention-days: 5
|
||||||
- name: Upload to code-scanning
|
- name: Upload to code-scanning
|
||||||
uses: github/codeql-action/upload-sarif@f6e388ebf0efc915c6c5b165b019ee61a6746a38 # v2.20.1
|
uses: github/codeql-action/upload-sarif@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8 # v2.21.5
|
||||||
with:
|
with:
|
||||||
sarif_file: results.sarif
|
sarif_file: results.sarif
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ jobs:
|
|||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
|
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # 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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
|
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # 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,
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -6,6 +6,11 @@ The [Authentication](../../usage/ci-configuration.md#authentication) environment
|
|||||||
|
|
||||||
**Note**: Make sure to configure your release branch as [protected](https://docs.gitlab.com/ce/user/project/protected_branches.html) in order for the CI/CD build to access the protected variables.
|
**Note**: Make sure to configure your release branch as [protected](https://docs.gitlab.com/ce/user/project/protected_branches.html) in order for the CI/CD build to access the protected variables.
|
||||||
|
|
||||||
|
## npm provenance
|
||||||
|
|
||||||
|
Since GitLab CI is a [supported provider](https://docs.npmjs.com/generating-provenance-statements#provenance-limitations) for [npm provenance](https://docs.npmjs.com/generating-provenance-statements), it is recommended to enable this to increase supply-chain security for your npm packages.
|
||||||
|
Find more detail about configuring npm to publish with provenance through semantic-release [in the documentation for our npm plugin](https://github.com/semantic-release/npm#npm-provenance).
|
||||||
|
|
||||||
## Node project configuration
|
## Node project configuration
|
||||||
|
|
||||||
GitLab CI supports [Pipelines](https://docs.gitlab.com/ee/ci/pipelines.html) allowing to test on multiple Node versions and publishing a release only when all test pass.
|
GitLab CI supports [Pipelines](https://docs.gitlab.com/ee/ci/pipelines.html) allowing to test on multiple Node versions and publishing a release only when all test pass.
|
||||||
|
|||||||
Vendored
+711
@@ -0,0 +1,711 @@
|
|||||||
|
declare interface AggregateError extends Error {
|
||||||
|
errors: any[];
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "semantic-release" {
|
||||||
|
import { Signale } from "signale";
|
||||||
|
export interface EnvCi {
|
||||||
|
/**
|
||||||
|
* Boolean, true if the environment is a CI environment
|
||||||
|
*/
|
||||||
|
isCi: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Commit hash
|
||||||
|
*/
|
||||||
|
commit: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Current branch name
|
||||||
|
*/
|
||||||
|
branch: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base context used in every semantic release step.
|
||||||
|
*/
|
||||||
|
export interface BaseContext {
|
||||||
|
/**
|
||||||
|
* stdout for semantic-release process
|
||||||
|
*/
|
||||||
|
stdout: NodeJS.WriteStream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* stderr for semantic-release process
|
||||||
|
*/
|
||||||
|
stderr: NodeJS.WriteStream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Signale console loger instance.
|
||||||
|
*
|
||||||
|
* Has error, log and success methods.
|
||||||
|
*/
|
||||||
|
logger: Signale<"error" | "log" | "success">;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Context used for the verify conditions step.
|
||||||
|
*/
|
||||||
|
export interface VerifyConditionsContext extends BaseContext {
|
||||||
|
/**
|
||||||
|
* The current working directory to use. It should be configured to
|
||||||
|
* the root of the Git repository to release from.
|
||||||
|
*
|
||||||
|
* It allows to run semantic-release from a specific path without
|
||||||
|
* having to change the local process cwd with process.chdir().
|
||||||
|
*
|
||||||
|
* @default process.cwd
|
||||||
|
*/
|
||||||
|
cwd?: string | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The environment variables to use.
|
||||||
|
*
|
||||||
|
* It allows to run semantic-release with specific environment
|
||||||
|
* variables without having to modify the local process.env.
|
||||||
|
*
|
||||||
|
* @default process.env
|
||||||
|
*/
|
||||||
|
env: Record<string, string>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Information about the CI environment.
|
||||||
|
*/
|
||||||
|
envCi: EnvCi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Information of the current branch
|
||||||
|
*/
|
||||||
|
branch: BranchObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Information on branches
|
||||||
|
*/
|
||||||
|
branches: ReadonlyArray<BranchObject>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Context used for the analyze commits step.
|
||||||
|
*/
|
||||||
|
export interface AnalyzeCommitsContext extends VerifyConditionsContext {
|
||||||
|
/**
|
||||||
|
* List of commits taken into account when determining the new version.
|
||||||
|
*/
|
||||||
|
commits: ReadonlyArray<Commit>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of releases
|
||||||
|
*/
|
||||||
|
releases: ReadonlyArray<Release>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Last release
|
||||||
|
*/
|
||||||
|
lastRelease: LastRelease;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Context used for the verify release step.
|
||||||
|
*/
|
||||||
|
export interface VerifyReleaseContext extends AnalyzeCommitsContext {
|
||||||
|
/**
|
||||||
|
* The next release.
|
||||||
|
*/
|
||||||
|
nextRelease: NextRelease;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Context used for the generate notes step.
|
||||||
|
*/
|
||||||
|
export type GenerateNotesContext = VerifyReleaseContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Context used for the add channel step.
|
||||||
|
*/
|
||||||
|
export type AddChannelContext = VerifyReleaseContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Context used for the prepare step.
|
||||||
|
*/
|
||||||
|
export type PrepareContext = VerifyReleaseContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Context used for the publish step.
|
||||||
|
*/
|
||||||
|
export type PublishContext = VerifyReleaseContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Context used for the success step.
|
||||||
|
*/
|
||||||
|
export type SuccessContext = VerifyReleaseContext;
|
||||||
|
|
||||||
|
export interface FailContext extends BaseContext {
|
||||||
|
/**
|
||||||
|
* Errors that occurred during the release process.
|
||||||
|
*/
|
||||||
|
errors: AggregateError;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Commit {
|
||||||
|
/**
|
||||||
|
* The commit abbreviated and full hash.
|
||||||
|
*/
|
||||||
|
commit: {
|
||||||
|
/**
|
||||||
|
* The commit hash.
|
||||||
|
*/
|
||||||
|
long: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The commit abbreviated hash.
|
||||||
|
*/
|
||||||
|
short: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The commit abbreviated and full tree hash.
|
||||||
|
*/
|
||||||
|
tree: {
|
||||||
|
/**
|
||||||
|
* The commit tree hash.
|
||||||
|
*/
|
||||||
|
long: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The commit abbreviated tree hash.
|
||||||
|
*/
|
||||||
|
short: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The commit author information.
|
||||||
|
*/
|
||||||
|
author: {
|
||||||
|
/**
|
||||||
|
* The commit author name.
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The commit author email.
|
||||||
|
*/
|
||||||
|
email: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The commit author date.
|
||||||
|
*/
|
||||||
|
short: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The committer information.
|
||||||
|
*/
|
||||||
|
committer: {
|
||||||
|
/**
|
||||||
|
* The committer name.
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The committer email.
|
||||||
|
*/
|
||||||
|
email: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The committer date.
|
||||||
|
*/
|
||||||
|
short: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The commit subject.
|
||||||
|
*/
|
||||||
|
subject: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The commit body.
|
||||||
|
*/
|
||||||
|
body: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The commit full message (subject and body).
|
||||||
|
*/
|
||||||
|
message: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The commit hash.
|
||||||
|
*/
|
||||||
|
hash: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The committer date.
|
||||||
|
*/
|
||||||
|
committerDate: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BranchObject {
|
||||||
|
/**
|
||||||
|
* The name of git branch.
|
||||||
|
*
|
||||||
|
* A `name` is required for all types of branch. It can be defined as a
|
||||||
|
* [glob](https://github.com/micromatch/micromatch#matching-features)
|
||||||
|
* in which case the definition will be expanded to one per matching
|
||||||
|
* branch existing in the repository.
|
||||||
|
*
|
||||||
|
* If `name` doesn't match any branch existing in the repository, the
|
||||||
|
* definition will be ignored. For example, the default configuration
|
||||||
|
* includes the definition `next` and `next-major` which will become
|
||||||
|
* active only when the branches `next` and/or `next-major` are
|
||||||
|
* created in the repository.
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The distribution channel on which to publish releases from this
|
||||||
|
* branch.
|
||||||
|
*
|
||||||
|
* If this field is set to `false`, then the branch will be released
|
||||||
|
* on the default distribution channel (for example the `@latest`
|
||||||
|
* [dist-tag](https://docs.npmjs.com/cli/dist-tag) for npm). This is
|
||||||
|
* also the default behavior for the first
|
||||||
|
* [release branch](https://semantic-release.gitbook.io/semantic-release/usage/workflow-configuration#release-branches)
|
||||||
|
* if the channel property is not set.
|
||||||
|
*
|
||||||
|
* For all other branches, if the channel property is not set, then the
|
||||||
|
* channel name will be the same as the branch name.
|
||||||
|
*
|
||||||
|
* The value of `channel`, if defined as a string, is generated with
|
||||||
|
* [Lodash template](https://lodash.com/docs#template) with the
|
||||||
|
* variable `name` set to the branch name.
|
||||||
|
*
|
||||||
|
* For example `{name: 'next', channel: 'channel-${name}'}` will be
|
||||||
|
* expanded to `{name: 'next', channel: 'channel-next'}`.
|
||||||
|
*/
|
||||||
|
channel?: string | false | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The range of [semantic versions](https://semver.org/) to support on
|
||||||
|
* this branch.
|
||||||
|
*
|
||||||
|
* A `range` only applies to maintenance branches and must be formatted
|
||||||
|
* like `N.N.x` or `N.x` (`N` is a number). If no range is specified
|
||||||
|
* but the `name` is formatted as a range, then the branch will be
|
||||||
|
* considered a maintenance branch and the `name` value will be used
|
||||||
|
* for the `range`.
|
||||||
|
*
|
||||||
|
* Required for maintenance branches, unless `name` is formatted like
|
||||||
|
* `N.N.x` or `N.x` (`N` is a number).
|
||||||
|
*/
|
||||||
|
range?: string | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The pre-release identifier to append to [semantic versions](https://semver.org/)
|
||||||
|
* released from this branch.
|
||||||
|
*
|
||||||
|
* A `prerelease` property applies only to pre-release branches and
|
||||||
|
* the `prerelease` value must be valid per the [Semantic Versioning
|
||||||
|
* Specification](https://semver.org/#spec-item-9). It will determine
|
||||||
|
* the name of versions. For example if `prerelease` is set to
|
||||||
|
* `"beta"`, the version will be formatted like `2.0.0-beta.1`,
|
||||||
|
* `2.0.0-beta.2`, etc.
|
||||||
|
*
|
||||||
|
* The value of `prerelease`, if defined as a string, is generated with
|
||||||
|
* [Lodash template](https://lodash.com/docs#template) with the
|
||||||
|
* variable `name` set to the name of the branch.
|
||||||
|
*
|
||||||
|
* If the `prerelease property is set to `true` then the name of the
|
||||||
|
* branch is used as the pre-release identifier.
|
||||||
|
*
|
||||||
|
* Required for pre-release branches.
|
||||||
|
*/
|
||||||
|
prerelease?: string | boolean | undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specifies a git branch holding commits to analyze and code to release.
|
||||||
|
*
|
||||||
|
* Each branch may be defined either by a string or an object. Specifying
|
||||||
|
* a string is a shortcut for specifying that string as the `name` field,
|
||||||
|
* for example `"master"` expands to `{name: "master"}`.
|
||||||
|
*/
|
||||||
|
export type BranchSpec = string | BranchObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A semver release type.
|
||||||
|
* See https://github.com/semantic-release/commit-analyzer/blob/master/lib/default-release-types.js
|
||||||
|
*/
|
||||||
|
export type ReleaseType = "prerelease" | "prepatch" | "patch" | "preminor" | "minor" | "premajor" | "major";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Details of a release published by a publish plugin.
|
||||||
|
*/
|
||||||
|
export interface Release {
|
||||||
|
/**
|
||||||
|
* The release name, only if set by the corresponding publish plugin.
|
||||||
|
*/
|
||||||
|
name?: string | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The release URL, only if set by the corresponding publish plugin.
|
||||||
|
*/
|
||||||
|
url?: string | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The semver export type of the release.
|
||||||
|
*/
|
||||||
|
type: ReleaseType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The version of the release.
|
||||||
|
*/
|
||||||
|
version: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The sha of the last commit being part of the release.
|
||||||
|
*/
|
||||||
|
gitHead: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Git tag associated with the release.
|
||||||
|
*/
|
||||||
|
gitTag: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The release notes for the release.
|
||||||
|
*/
|
||||||
|
notes: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name of the plugin that published the release.
|
||||||
|
*/
|
||||||
|
pluginName: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LastRelease {
|
||||||
|
/**
|
||||||
|
* The version name of the release.
|
||||||
|
*/
|
||||||
|
version: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Git tag of the release.
|
||||||
|
*/
|
||||||
|
gitTag: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of channels the release was published to.
|
||||||
|
*/
|
||||||
|
channels: string[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Git checksum of the last commit of the release.
|
||||||
|
*/
|
||||||
|
gitHead: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Release name
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface NextRelease extends Omit<LastRelease, "channels"> {
|
||||||
|
/**
|
||||||
|
* The semver export type of the release.
|
||||||
|
*/
|
||||||
|
type: ReleaseType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The release channel of the release.
|
||||||
|
*/
|
||||||
|
channel: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The release notes of the next release.
|
||||||
|
*/
|
||||||
|
notes?: string | undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specifies a plugin to use.
|
||||||
|
*
|
||||||
|
* The plugin is specified by its module name.
|
||||||
|
*
|
||||||
|
* To pass options to a plugin, specify an array containing the plugin module
|
||||||
|
* name and an options object.
|
||||||
|
*/
|
||||||
|
export type PluginSpec<T = any> = string | [string, T];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* semantic-release options, after normalization and defaults have been
|
||||||
|
* applied.
|
||||||
|
*/
|
||||||
|
export interface GlobalConfig extends Options {
|
||||||
|
/**
|
||||||
|
* The branches on which releases should happen. By default
|
||||||
|
* **semantic-release** will release:
|
||||||
|
*
|
||||||
|
* * regular releases to the default distribution channel from the
|
||||||
|
* branch `master`
|
||||||
|
* * regular releases to a distribution channel matching the branch
|
||||||
|
* name from any existing branch with a name matching a maintenance
|
||||||
|
* release range (`N.N.x` or `N.x.x` or `N.x` with `N` being a
|
||||||
|
* number)
|
||||||
|
* * regular releases to the `next` distribution channel from the
|
||||||
|
* branch `next` if it exists
|
||||||
|
* * regular releases to the `next-major` distribution channel from
|
||||||
|
* the branch `next-major` if it exists.
|
||||||
|
* * prereleases to the `beta` distribution channel from the branch
|
||||||
|
* `beta` if it exists
|
||||||
|
* * prereleases to the `alpha` distribution channel from the branch
|
||||||
|
* `alpha` if it exists
|
||||||
|
*
|
||||||
|
* **Note**: If your repository does not have a release branch, then
|
||||||
|
* **semantic-release** will fail with an `ERELEASEBRANCHES` error
|
||||||
|
* message. If you are using the default configuration, you can fix
|
||||||
|
* this error by pushing a `master` branch.
|
||||||
|
*
|
||||||
|
* **Note**: Once **semantic-release** is configured, any user with the
|
||||||
|
* permission to push commits on one of those branches will be able to
|
||||||
|
* publish a release. It is recommended to protect those branches, for
|
||||||
|
* example with [GitHub protected branches](https://help.github.com/articles/about-protected-branches).
|
||||||
|
*
|
||||||
|
* See [Workflow configuration](https://semantic-release.gitbook.io/semantic-release/usage/workflow-configuration#workflow-configuration)
|
||||||
|
* for more details.
|
||||||
|
*/
|
||||||
|
branches: ReadonlyArray<BranchSpec> | BranchSpec;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The git repository URL.
|
||||||
|
*
|
||||||
|
* Any valid git url format is supported (see
|
||||||
|
* [git protocols](https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols))
|
||||||
|
*
|
||||||
|
* Default: `repository` property in `package.json`, or git origin url.
|
||||||
|
*/
|
||||||
|
repositoryUrl: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The git tag format used by **semantic-release** to identify
|
||||||
|
* releases. The tag name is generated with [Lodash template](https://lodash.com/docs#template)
|
||||||
|
* and will be compiled with the `version` variable.
|
||||||
|
*
|
||||||
|
* **Note**: The `tagFormat` must contain the `version` variable
|
||||||
|
* exactly once and compile to a
|
||||||
|
* [valid git reference](https://git-scm.com/docs/git-check-ref-format#_description).
|
||||||
|
*/
|
||||||
|
tagFormat: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the list of plugins to use. Plugins will run in series, in
|
||||||
|
* the order defined, for each [step](https://semantic-release.gitbook.io/semantic-release/#release-steps)
|
||||||
|
* if they implement it.
|
||||||
|
*
|
||||||
|
* Plugins configuration can be defined by wrapping the name and an
|
||||||
|
* options object in an array.
|
||||||
|
*
|
||||||
|
* See [Plugins configuration](https://semantic-release.gitbook.io/semantic-release/usage/plugins#plugins)
|
||||||
|
* for more details.
|
||||||
|
*
|
||||||
|
* Default: `[
|
||||||
|
* "@semantic-release/commit-analyzer",
|
||||||
|
* "@semantic-release/release-notes-generator",
|
||||||
|
* "@semantic-release/npm",
|
||||||
|
* "@semantic-release/github"
|
||||||
|
* ]`
|
||||||
|
*/
|
||||||
|
plugins: ReadonlyArray<PluginSpec>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** semantic-release configuration specific for API usage. */
|
||||||
|
export interface Config {
|
||||||
|
/**
|
||||||
|
* The current working directory to use. It should be configured to
|
||||||
|
* the root of the Git repository to release from.
|
||||||
|
*
|
||||||
|
* It allows to run semantic-release from a specific path without
|
||||||
|
* having to change the local process cwd with process.chdir().
|
||||||
|
*
|
||||||
|
* @default process.cwd
|
||||||
|
*/
|
||||||
|
cwd?: string | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The environment variables to use.
|
||||||
|
*
|
||||||
|
* It allows to run semantic-release with specific environment
|
||||||
|
* variables without having to modify the local process.env.
|
||||||
|
*
|
||||||
|
* @default process.env
|
||||||
|
*/
|
||||||
|
env?: Record<string, any> | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The writable stream used to log information.
|
||||||
|
*
|
||||||
|
* It allows to configure semantic-release to write logs to a specific
|
||||||
|
* stream rather than the local process.stdout.
|
||||||
|
*
|
||||||
|
* @default process.stdout
|
||||||
|
*/
|
||||||
|
stdout?: NodeJS.WriteStream | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The writable stream used to log errors.
|
||||||
|
*
|
||||||
|
* It allows to configure semantic-release to write errors to a
|
||||||
|
* specific stream rather than the local process.stderr.
|
||||||
|
*
|
||||||
|
* @default process.stderr
|
||||||
|
*/
|
||||||
|
stderr?: NodeJS.WriteStream | undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* semantic-release options.
|
||||||
|
*
|
||||||
|
* Can be used to set any core option or plugin options.
|
||||||
|
* Each option will take precedence over options configured in the
|
||||||
|
* configuration file and shareable configurations.
|
||||||
|
*/
|
||||||
|
export interface Options {
|
||||||
|
/**
|
||||||
|
* List of modules or file paths containing a
|
||||||
|
* [shareable configuration](https://semantic-release.gitbook.io/semantic-release/usage/shareable-configurations).
|
||||||
|
* If multiple shareable configurations are set, they will be imported
|
||||||
|
* in the order defined with each configuration option taking
|
||||||
|
* precedence over the options defined in a previous shareable
|
||||||
|
* configuration.
|
||||||
|
*
|
||||||
|
* **Note**: Options defined via CLI arguments or in the configuration
|
||||||
|
* file will take precedence over the ones defined in any shareable
|
||||||
|
* configuration.
|
||||||
|
*/
|
||||||
|
extends?: ReadonlyArray<string> | string | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The branches on which releases should happen. By default
|
||||||
|
* **semantic-release** will release:
|
||||||
|
*
|
||||||
|
* * regular releases to the default distribution channel from the
|
||||||
|
* branch `master`
|
||||||
|
* * regular releases to a distribution channel matching the branch
|
||||||
|
* name from any existing branch with a name matching a maintenance
|
||||||
|
* release range (`N.N.x` or `N.x.x` or `N.x` with `N` being a
|
||||||
|
* number)
|
||||||
|
* * regular releases to the `next` distribution channel from the
|
||||||
|
* branch `next` if it exists
|
||||||
|
* * regular releases to the `next-major` distribution channel from
|
||||||
|
* the branch `next-major` if it exists.
|
||||||
|
* * prereleases to the `beta` distribution channel from the branch
|
||||||
|
* `beta` if it exists
|
||||||
|
* * prereleases to the `alpha` distribution channel from the branch
|
||||||
|
* `alpha` if it exists
|
||||||
|
*
|
||||||
|
* **Note**: If your repository does not have a release branch, then
|
||||||
|
* **semantic-release** will fail with an `ERELEASEBRANCHES` error
|
||||||
|
* message. If you are using the default configuration, you can fix
|
||||||
|
* this error by pushing a `master` branch.
|
||||||
|
*
|
||||||
|
* **Note**: Once **semantic-release** is configured, any user with the
|
||||||
|
* permission to push commits on one of those branches will be able to
|
||||||
|
* publish a release. It is recommended to protect those branches, for
|
||||||
|
* example with [GitHub protected branches](https://help.github.com/articles/about-protected-branches).
|
||||||
|
*
|
||||||
|
* See [Workflow configuration](https://semantic-release.gitbook.io/semantic-release/usage/workflow-configuration#workflow-configuration)
|
||||||
|
* for more details.
|
||||||
|
*/
|
||||||
|
branches?: ReadonlyArray<BranchSpec> | BranchSpec | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The git repository URL.
|
||||||
|
*
|
||||||
|
* Any valid git url format is supported (see
|
||||||
|
* [git protocols](https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols))
|
||||||
|
*
|
||||||
|
* Default: `repository` property in `package.json`, or git origin url.
|
||||||
|
*/
|
||||||
|
repositoryUrl?: string | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The git tag format used by **semantic-release** to identify
|
||||||
|
* releases. The tag name is generated with [Lodash template](https://lodash.com/docs#template)
|
||||||
|
* and will be compiled with the `version` variable.
|
||||||
|
*
|
||||||
|
* **Note**: The `tagFormat` must contain the `version` variable
|
||||||
|
* exactly once and compile to a
|
||||||
|
* [valid git reference](https://git-scm.com/docs/git-check-ref-format#_description).
|
||||||
|
*/
|
||||||
|
tagFormat?: string | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the list of plugins to use. Plugins will run in series, in
|
||||||
|
* the order defined, for each [step](https://semantic-release.gitbook.io/semantic-release/#release-steps)
|
||||||
|
* if they implement it.
|
||||||
|
*
|
||||||
|
* Plugins configuration can be defined by wrapping the name and an
|
||||||
|
* options object in an array.
|
||||||
|
*
|
||||||
|
* See [Plugins configuration](https://semantic-release.gitbook.io/semantic-release/usage/plugins#plugins)
|
||||||
|
* for more details.
|
||||||
|
*
|
||||||
|
* Default: `[
|
||||||
|
* "@semantic-release/commit-analyzer",
|
||||||
|
* "@semantic-release/release-notes-generator",
|
||||||
|
* "@semantic-release/npm",
|
||||||
|
* "@semantic-release/github"
|
||||||
|
* ]`
|
||||||
|
*/
|
||||||
|
plugins?: ReadonlyArray<PluginSpec> | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dry-run mode, skip publishing, print next version and release notes.
|
||||||
|
*/
|
||||||
|
dryRun?: boolean | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to false to skip Continuous Integration environment verifications.
|
||||||
|
* This allows for making releases from a local machine.
|
||||||
|
*/
|
||||||
|
ci?: boolean | undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Any other options supported by plugins.
|
||||||
|
*/
|
||||||
|
[name: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An object with details of the release if a release was published, or
|
||||||
|
* false if no release was published.
|
||||||
|
*/
|
||||||
|
export type Result =
|
||||||
|
| false
|
||||||
|
| {
|
||||||
|
/**
|
||||||
|
* Information related to the last release found.
|
||||||
|
*/
|
||||||
|
lastRelease: LastRelease;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The list of commits included in the new release.
|
||||||
|
*/
|
||||||
|
commits: Commit[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Information related to the newly published release.
|
||||||
|
*/
|
||||||
|
nextRelease: NextRelease;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The list of releases published, one release per publish plugin.
|
||||||
|
*/
|
||||||
|
releases: Release[];
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run semantic-release and returns a Promise that resolves to a Result
|
||||||
|
* object.
|
||||||
|
* @async
|
||||||
|
*/
|
||||||
|
export default function (options: Options, environment?: Config): Promise<Result>;
|
||||||
|
}
|
||||||
Generated
+673
-7193
File diff suppressed because it is too large
Load Diff
+12
-10
@@ -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",
|
"@semantic-release/commit-analyzer": "^11.0.0-beta.1",
|
||||||
"@semantic-release/error": "^4.0.0",
|
"@semantic-release/error": "^4.0.0",
|
||||||
"@semantic-release/github": "^9.0.0",
|
"@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": "^12.0.0-beta.1",
|
||||||
"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": "^5.0.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",
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"ava": "5.3.1",
|
"ava": "5.3.1",
|
||||||
"c8": "8.0.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",
|
||||||
@@ -66,12 +66,12 @@
|
|||||||
"got": "13.0.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": "6.0.0",
|
||||||
"prettier": "2.8.8",
|
"prettier": "3.0.3",
|
||||||
"sinon": "15.2.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": {
|
||||||
@@ -81,6 +81,7 @@
|
|||||||
"bin",
|
"bin",
|
||||||
"docs",
|
"docs",
|
||||||
"lib",
|
"lib",
|
||||||
|
"index.d.ts",
|
||||||
"index.js",
|
"index.js",
|
||||||
"cli.js"
|
"cli.js"
|
||||||
],
|
],
|
||||||
@@ -98,6 +99,7 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
"types": "index.d.ts",
|
||||||
"c8": {
|
"c8": {
|
||||||
"include": [
|
"include": [
|
||||||
"lib/**/*.js",
|
"lib/**/*.js",
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user