Compare commits

...
85 Commits
Author SHA1 Message Date
9faded8d50 fix(deps): update dependency marked-terminal to v7
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-06 09:37:02 -08:00
fccab39b87 chore(deps): lock file maintenance (#3179)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-05 01:23:19 +00:00
6be228070f chore(deps): update dependency got to v14.2.0 (#3175)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-03 13:53:59 +00:00
518b47d030 chore(deps): update dependency npm-run-all2 to v6.1.2 (#3171)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-02 23:06:08 +00:00
c6c01aa1ae ci(action): update github/codeql-action action to v3.24.0 (#3173)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-02 22:30:01 +00:00
ee4f99f0cf chore(deps): update dependency ava to v6.1.1 (#3168)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-30 05:15:45 +00:00
9b9c9b76c3 chore(deps): update dependency got to v14.1.0 (#3167)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-29 14:53:22 +00:00
Matt TraviandGitHub 211704d102 Merge pull request #3166 from knownasnaffy/patch-1
Docs: fix typo in JS API guide
2024-01-29 08:50:14 -06:00
Barinderpreet SinghandGitHub 01779f4efa docs: fix typo in JS API guide 2024-01-29 19:57:56 +05:30
95ea5ef9b7 chore(deps): lock file maintenance (#3165)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-29 03:53:31 +00:00
2fd9685bff chore(deps): update dependency nock to v13.5.1 (#3164)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-28 21:18:00 +00:00
c85cde96f2 ci(action): update github/codeql-action action to v3.23.2 (#3161)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-26 16:35:46 +00:00
ac5fdeaf05 chore(deps): lock file maintenance (#3155)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-24 01:10:53 +00:00
4044e7a932 ci(action): update github/codeql-action action to v3.23.1 (#3149)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-23 23:09:00 +00:00
440d0661eb ci(action): update actions/upload-artifact action to v4.3.0 (#3156)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-23 18:35:58 +00:00
6e57047eca ci(action): update actions/upload-artifact action to v4.2.0 (#3151)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-22 00:24:38 +00:00
58b338bc9b chore(deps): update dependency ava to v6.1.0 (#3154)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-21 22:46:36 +00:00
4692834087 chore(deps): update dependency prettier to v3.2.4 (#3147)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-17 10:53:25 +00:00
2c04f32744 chore(deps): lock file maintenance (#3143)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-15 05:53:20 +00:00
c5071df260 chore(deps): update dependency c8 to v9.1.0 (#3139)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-14 22:27:03 +00:00
2096d44b0c chore(deps): update dependency nock to v13.5.0 (#3142)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-14 20:15:58 +00:00
2c0b371f7b chore(deps): update dependency prettier to v3.2.2 (#3140)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-14 05:22:19 +00:00
a2de1057b7 ci(action): update actions/upload-artifact action to v4.1.0 (#3141)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-12 22:00:16 +00:00
Matt TraviandGitHub 58e21774cb next major (#3111) 2024-01-12 15:55:05 -06:00
Matt Travi 8066b7fd54 Merge branch 'master' of github.com:semantic-release/semantic-release into beta 2024-01-12 13:21:47 -06:00
f31d43c429 ci(action): update github/codeql-action action to v3.23.0 (#3136)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-08 17:34:06 +00:00
13f980149a chore(deps): lock file maintenance (#3134)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-08 01:54:31 +00:00
020ea7d7d5 fix: use one note reference per tag to prevent conflicts (#2085)
Co-authored-by: Matt Travi <126441+travi@users.noreply.github.com>
2024-01-05 14:51:59 -06:00
6d2a6f1aa6 fix(deps): update dependency marked to v11 (#3079)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Matt Travi <programmer@travi.org>
2024-01-05 14:27:04 -06:00
Matt TraviandGitHub ce580be16d Merge branch 'master' into beta 2024-01-05 13:48:05 -06:00
d4b7c9a23d chore(deps): update dependency c8 to v9 (#3128)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-05 19:47:05 +00:00
Matt Travi 7983c57300 ci(renovate): fixed reference to the org-level config 2024-01-01 15:06:05 -06:00
50ad70f229 chore(deps): lock file maintenance (#3126)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-01 06:18:39 +00:00
90513bbc0a chore(deps): update dependency publint to v0.2.7 (#3122)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-28 04:53:48 +00:00
b07ddfaaf9 chore(deps): update dependency dockerode to v4.0.2 (#3124)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-28 02:10:29 +00:00
acd6f05dad ci(action): update github/codeql-action action to v3.22.12 (#3120)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-25 16:13:16 +00:00
5a7fa82309 chore(deps): update dependency dockerode to v4.0.1 (#3121)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-25 03:38:41 +00:00
81346ff687 chore(deps): lock file maintenance (#3123)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-25 01:45:52 +00:00
a8e0d6d611 chore(deps): update dependency p-retry to v6.2.0 (#3118)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-20 21:33:41 +00:00
Matt Travi afc7518c50 docs: fixed links
fixes #3114
2023-12-18 22:11:31 -06:00
ee110291b2 ci(action): update actions/upload-artifact action to v4 (#3109)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-18 15:58:43 +00:00
f021f25ad2 ci(action): update actions/setup-node action to v4.0.1 (#3116)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-18 12:24:28 +00:00
fd2c179131 chore(deps): lock file maintenance (#3115)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-18 00:37:23 +00:00
Matt Travi ad8f5b2608 docs(node-versions): updated the minimum documented node version in the node requirement doc
relates to https://github.com/semantic-release/semantic-release/issues/3106
2023-12-16 22:32:03 -06:00
Matt Travi 0d0ed9d08a fix(deps): upgraded to the latest version of env-ci
BREAKING CHANGE: woodpecker ci users need to upgrade to v1.0.0 or higher to remain supported. see
https://github.com/semantic-release/env-ci/releases/tag/v11.0.0 for more information
2023-12-16 10:12:05 -06:00
Matt Travi 2904832967 feat(node-versions): dropped support for node v18 and raised the minimum for v20
reasoning for the chosen version:
https://github.com/semantic-release/gitlab/pull/647#discussion_r1423131205

BREAKING CHANGE: support for node v18 has been dropped and the minimum for v20 is now v20.8.1

related to https://github.com/semantic-release/semantic-release/discussions/3088
2023-12-15 17:01:50 -06:00
Matt Travi abf8ddd978 ci(verify): avoid uncancellable workflow
https://github.com/semantic-release/.github/issues/19#issuecomment-1800963916

for semantic-release/.github#19
2023-12-15 16:47:07 -06:00
renovate[bot]andGitHub 07dde042bb fix(deps): update dependency cosmiconfig to v9 (#3105)
BREAKING CHANGE: if using `release.config.js` as the name of your config file, it needs to be moved to a `.config/` directory. see https://github.com/cosmiconfig/cosmiconfig/releases/tag/v9.0.0 for more detail
2023-12-15 16:27:25 -06:00
2557e9e8f1 ci(action): update github/codeql-action action to v3 (#3108)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-13 20:06:10 +00:00
786b48f886 ci(action): update github/codeql-action action to v2.22.10 (#3107)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-12 19:50:05 +00:00
Gregor MartynusandGitHub f6f1bf167c fix: Revert "fix(deps): update dependency cosmiconfig to v9" (#3104)
This reverts commit b38cd2e44e.
2023-12-11 20:28:12 -08:00
b38cd2e44e fix(deps): update dependency cosmiconfig to v9
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-11 15:04:52 -08:00
3722204510 chore(deps): lock file maintenance (#3101)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-11 18:25:02 +00:00
1fd1ce85eb chore(deps): update dependency prettier to v3.1.1 (#3099)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-10 09:29:39 +00:00
Matt TraviandGitHub 00e7ca8d2e docs(getting-started): fix rendering through gitbook 2023-12-09 16:31:45 -06:00
Matt TraviandGitHub 9912d34b8d docs(cli): stop recommending setup with the cli (#3098)
since we have not been keeping up with maintenance of the cli and it has known problems that are
likely to cause more pain than it is helpful
2023-12-09 12:38:45 -08:00
f72e493d69 ci(action): update github/codeql-action action to v2.22.9 (#3094)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-07 13:03:33 +00:00
e8d3b2eede chore(deps): update dependency ava to v6.0.1 (#3092)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-07 01:46:18 +00:00
Matt Travi 88efeadac9 fix: revert updating cosmiconfig to v9 2023-12-05 23:17:13 -06:00
Matt TraviandGitHub 3a2acce01f Revert "fix(deps): update dependency cosmiconfig to v9" (#3090) 2023-12-05 23:06:46 -06:00
8b0dbd2805 fix(deps): update dependency cosmiconfig to v9 (#3072)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-04 20:45:33 -06:00
5aa56da694 chore(deps): update dependency ava to v6 (#3087)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-05 01:18:45 +00:00
c516d59bf0 chore(deps): lock file maintenance (#3086)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-04 04:07:48 +00:00
67995485c3 chore(deps): update dependency got to v14 (#3081)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-01 23:46:53 +00:00
14a5755ef1 chore(deps): update dependency publint to v0.2.6 (#3083)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-01 18:37:27 +00:00
f6fb0fc130 chore(deps): update dependency fs-extra to v11.2.0 (#3077)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-28 01:55:16 +00:00
5ca3d78c63 chore(deps): update dependency nock to v13.4.0 (#3076)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-27 21:44:20 +00:00
cac1dbb121 chore(deps): lock file maintenance (#3073)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-27 01:21:45 +00:00
29aefa4b87 ci(action): update github/codeql-action action to v2.22.8 (#3071)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-23 12:44:40 +00:00
Thomas BriotandGitHub 3d8c7154b2 docs: fix broken link to 'sentimental versioning' resource (#3067) 2023-11-19 21:20:11 -06:00
ea446a4ea4 chore(deps): lock file maintenance (#3068)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-20 02:15:57 +00:00
Pierre CavinandGitHub 0d06f62411 fix: support windows absolute extends (#3062) 2023-11-16 20:04:02 -06:00
26df1d2aa1 ci(action): update github/codeql-action action to v2.22.7 (#3061)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-16 13:30:07 +00:00
b3a87bfa8f chore(deps): update dependency ls-engines to v0.9.1 (#3060)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-16 03:54:29 +00:00
b36036e920 ci(action): update github/codeql-action action to v2.22.6 (#3058)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-14 13:31:15 +00:00
c084008274 chore(deps): update dependency prettier to v3.1.0 (#3057)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-13 04:46:59 +00:00
9fd162b3bc chore(deps): lock file maintenance (#3056)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-13 01:44:53 +00:00
c129474e93 chore(deps): update dependency testdouble to v3.20.1 (#3055)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-12 19:58:06 +00:00
02f2cb1c8b chore(deps): lock file maintenance (#3048)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-09 06:02:13 +00:00
xiaolou86andGitHub b1683a7b4d docs: fix typos (#3052) 2023-11-08 23:56:53 -06:00
f09e55f39f fix(deps): update dependency read-pkg-up to v11 (#3047)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-03 15:56:47 -05:00
9e41b43294 chore(deps): lock file maintenance (#3034)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-03 20:38:34 +00:00
6900865324 Support extending ESM based configurations (#3037)
Co-authored-by: Matt Travi <programmer@travi.org>
2023-11-03 15:33:43 -05:00
250e7ae2c5 chore(deps): update dependency nock to v13.3.8 (#3045)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-03 07:45:15 +00:00
50a789638c chore(deps): update dependency sinon to v17.0.1 (#3042)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-01 12:41:52 +00:00
21 changed files with 2435 additions and 2258 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
cache: npm
node-version: lts/*
+2 -2
View File
@@ -25,12 +25,12 @@ jobs:
results_format: sarif
publish_results: true
- name: Upload artifact
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: SARIF file
path: results.sarif
retention-days: 5
- name: Upload to code-scanning
uses: github/codeql-action/upload-sarif@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5
uses: github/codeql-action/upload-sarif@e8893c57a1f3a2b659b6b55564fdfdbbd2982911 # v3.24.0
with:
sarif_file: results.sarif
+5 -5
View File
@@ -25,9 +25,9 @@ jobs:
strategy:
matrix:
node-version:
- 18.17.0
- 20.6.1
- 20.8.1
- 20
- 21
runs-on: ubuntu-latest
timeout-minutes: 5
@@ -37,7 +37,7 @@ jobs:
- run: git config --global user.name github-actions
- run: git config --global user.email github-actions@github.com
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: ${{ matrix.node-version }}
cache: npm
@@ -55,7 +55,7 @@ jobs:
- run: git config --global user.name github-actions
- run: git config --global user.email github-actions@github.com
- name: Use Node.js from .nvmrc
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version-file: .nvmrc
cache: npm
@@ -70,7 +70,7 @@ jobs:
needs:
- test_dev
- test_matrix
if: always()
if: ${{ !cancelled() }}
steps:
- name: All matrix versions passed
if: ${{ !(contains(needs.*.result, 'failure')) }}
+4 -4
View File
@@ -69,7 +69,7 @@ The table below shows which commit message gets you which release type when `sem
### Automation with CI
**semantic-release** is meant to be executed on the CI environment after every successful build on the release branch.
This way no human is directly involved in the release process and the releases are guaranteed to be [unromantic and unsentimental](http://sentimentalversioning.org).
This way no human is directly involved in the release process and the releases are guaranteed to be [unromantic and unsentimental](https://github.com/dominictarr/sentimental-versioning#readme).
### Triggering a release
@@ -110,9 +110,9 @@ In order to use **semantic-release** you need:
## Documentation
- Usage
- [Getting started](docs/usage/getting-started.md#getting-started)
- [Installation](docs/usage/installation.md#installation)
- [CI Configuration](docs/usage/ci-configuration.md#ci-configuration)
- [Getting started](docs/usage/getting-started.md)
- [Installation](docs/usage/installation.md)
- [CI Configuration](docs/usage/ci-configuration.md)
- [Configuration](docs/usage/configuration.md#configuration)
- [Plugins](docs/usage/plugins.md)
- [Workflow configuration](docs/usage/workflow-configuration.md)
+1 -1
View File
@@ -2,7 +2,7 @@
## Usage
- [Getting started](docs/usage/getting-started.md#getting-started)
- [Getting started](docs/usage/getting-started.md)
- [Installation](docs/usage/installation.md)
- [CI Configuration](docs/usage/ci-configuration.md)
- [Configuration](docs/usage/configuration.md)
+2 -2
View File
@@ -127,7 +127,7 @@ It allows to configure **semantic-release** to write errors to a specific stream
Type: `Object` `Boolean`<br>
And object with [`lastRelease`](#lastrelease), [`nextRelease`](#nextrelease), [`commits`](#commits) and [`releases`](#releases) if a release is published or `false` if no release was published.
An object with [`lastRelease`](#lastrelease), [`nextRelease`](#nextrelease), [`commits`](#commits) and [`releases`](#releases) if a release is published or `false` if no release was published.
#### lastRelease
@@ -159,7 +159,7 @@ Example:
Type: `Array<Object>`
The list of commit included in the new release.<br>
The list of commit(s) included in the new release.<br>
Each commit object has the following properties:
| Name | Type | Description |
+1 -1
View File
@@ -1,6 +1,6 @@
# Node version requirement
**semantic-release** is written using the latest [ECMAScript 2017](https://www.ecma-international.org/publications/standards/Ecma-262.htm) features, without transpilation which **requires Node version 18.0.0 or higher**.
**semantic-release** is written using the latest [ECMAScript 2017](https://www.ecma-international.org/publications/standards/Ecma-262.htm) features, without transpilation which **requires Node version 20.8.1 or higher**.
**semantic-release** is meant to be used in a CI environment as a development support tool, not as a production dependency.
Therefore, the only constraint is to run the `semantic-release` in a CI environment providing version of Node that meets our version requirement.
-13
View File
@@ -6,16 +6,3 @@ In order to use **semantic-release** you must follow these steps:
2. Configure your Continuous Integration service to [run **semantic-release**](./ci-configuration.md#run-semantic-release-only-after-all-tests-succeeded)
3. Configure your Git repository and package manager repository [authentication](ci-configuration.md#authentication) in your Continuous Integration service
4. Configure **semantic-release** [options and plugins](./configuration.md#configuration)
Alternatively those steps can be easily done with the [**semantic-release** interactive CLI](https://github.com/semantic-release/cli):
```bash
cd your-module
npx semantic-release-cli setup
```
![dialogue](../../media/semantic-release-cli.png)
See the [semantic-release-cli](https://github.com/semantic-release/cli#what-it-does) documentation for more details.
**Note**: only a limited number of options, CI services and plugins are currently supported by `semantic-release-cli`.
+7 -4
View File
@@ -123,12 +123,15 @@ async function run(context, plugins) {
if (options.dryRun) {
logger.warn(`Skip ${nextRelease.gitTag} tag creation in dry-run mode`);
} else {
await addNote({ channels: [...currentRelease.channels, nextRelease.channel] }, nextRelease.gitHead, {
await addNote({ channels: [...currentRelease.channels, nextRelease.channel] }, nextRelease.gitTag, {
cwd,
env,
});
await push(options.repositoryUrl, { cwd, env });
await pushNotes(options.repositoryUrl, { cwd, env });
await pushNotes(options.repositoryUrl, nextRelease.gitTag, {
cwd,
env,
});
logger.success(
`Add ${nextRelease.channel ? `channel ${nextRelease.channel}` : "default channel"} to tag ${
nextRelease.gitTag
@@ -203,9 +206,9 @@ async function run(context, plugins) {
} else {
// Create the tag before calling the publish plugins as some require the tag to exists
await tag(nextRelease.gitTag, nextRelease.gitHead, { cwd, env });
await addNote({ channels: [nextRelease.channel] }, nextRelease.gitHead, { cwd, env });
await addNote({ channels: [nextRelease.channel] }, nextRelease.gitTag, { cwd, env });
await push(options.repositoryUrl, { cwd, env });
await pushNotes(options.repositoryUrl, { cwd, env });
await pushNotes(options.repositoryUrl, nextRelease.gitTag, { cwd, env });
logger.success(`Created tag ${nextRelease.gitTag}`);
}
+1 -1
View File
@@ -60,7 +60,7 @@ export function release({ release }) {
return release;
}
// The intial lastVersion is the last release from the base branch of `FIRST_RELEASE` (1.0.0)
// The initial lastVersion is the last release from the base branch of `FIRST_RELEASE` (1.0.0)
let lastVersion = getLatestVersion(tagsToVersions(release[0].tags)) || FIRST_RELEASE;
return release.map(({ name, tags, channel, ...rest }, idx) => {
+3 -5
View File
@@ -1,11 +1,10 @@
import { dirname, resolve } from "node:path";
import { dirname } from "node:path";
import { fileURLToPath } from "node:url";
import { createRequire } from "node:module";
import { castArray, isNil, isPlainObject, isString, pickBy } from "lodash-es";
import { readPackageUp } from "read-pkg-up";
import { cosmiconfig } from "cosmiconfig";
import resolveFrom from "resolve-from";
import importFrom from "import-from-esm";
import debugConfig from "debug";
import { repoUrl } from "./git.js";
import PLUGINS_DEFINITIONS from "./definitions/plugins.js";
@@ -14,7 +13,6 @@ import { parseConfig, validatePlugin } from "./plugins/utils.js";
const debug = debugConfig("semantic-release:config");
const __dirname = dirname(fileURLToPath(import.meta.url));
const require = createRequire(import.meta.url);
const CONFIG_NAME = "release";
@@ -35,7 +33,7 @@ export default async (context, cliOptions) => {
options = {
...(await castArray(extendPaths).reduce(async (eventualResult, extendPath) => {
const result = await eventualResult;
const extendsOptions = require(resolveFrom.silent(__dirname, extendPath) || resolveFrom(cwd, extendPath));
const extendsOptions = (await importFrom.silent(__dirname, extendPath)) || (await importFrom(cwd, extendPath));
// For each plugin defined in a shareable config, save in `pluginsPath` the extendable config path,
// so those plugin will be loaded relative to the config file
+1 -1
View File
@@ -36,7 +36,7 @@ function formatAuthUrl(protocol, repositoryUrl, gitCredentials) {
* @param {Object} context semantic-release context.
* @param {String} authUrl Repository URL to verify
*
* @return {String} The authUrl as is if the connection was successfull, null otherwise
* @return {String} The authUrl as is if the connection was successful, null otherwise
*/
async function ensureValidAuthUrl({ cwd, env, branch }, authUrl) {
try {
+39 -10
View File
@@ -2,6 +2,7 @@ import gitLogParser from "git-log-parser";
import getStream from "get-stream";
import { execa } from "execa";
import debugGit from "debug";
import { merge } from "lodash-es";
import { GIT_NOTE_REF } from "./definitions/constants.js";
const debug = debugGit("semantic-release:git");
@@ -141,13 +142,9 @@ export async function fetch(repositoryUrl, branch, ciBranch, execaOptions) {
*/
export async function fetchNotes(repositoryUrl, execaOptions) {
try {
await execa(
"git",
["fetch", "--unshallow", repositoryUrl, `+refs/notes/${GIT_NOTE_REF}:refs/notes/${GIT_NOTE_REF}`],
execaOptions
);
await execa("git", ["fetch", "--unshallow", repositoryUrl, `+refs/notes/*:refs/notes/*`], execaOptions);
} catch {
await execa("git", ["fetch", repositoryUrl, `+refs/notes/${GIT_NOTE_REF}:refs/notes/${GIT_NOTE_REF}`], {
await execa("git", ["fetch", repositoryUrl, `+refs/notes/*:refs/notes/*`], {
...execaOptions,
reject: false,
});
@@ -246,8 +243,8 @@ export async function push(repositoryUrl, execaOptions) {
*
* @throws {Error} if the push failed.
*/
export async function pushNotes(repositoryUrl, execaOptions) {
await execa("git", ["push", repositoryUrl, `refs/notes/${GIT_NOTE_REF}`], execaOptions);
export async function pushNotes(repositoryUrl, ref, execaOptions) {
await execa("git", ["push", repositoryUrl, `refs/notes/${GIT_NOTE_REF}-${ref}`], execaOptions);
}
/**
@@ -307,8 +304,26 @@ export async function isBranchUpToDate(repositoryUrl, branch, execaOptions) {
* @return {Object} the parsed JSON note if there is one, an empty object otherwise.
*/
export async function getNote(ref, execaOptions) {
const handleError = (error) => {
if (error.exitCode === 1) {
return { stdout: "{}" };
}
debug(error);
throw error;
};
try {
return JSON.parse((await execa("git", ["notes", "--ref", GIT_NOTE_REF, "show", ref], execaOptions)).stdout);
return merge(
JSON.parse(
// Used for retro-compatibility
(await execa("git", ["notes", "--ref", GIT_NOTE_REF, "show", ref], execaOptions).catch(handleError)).stdout
),
JSON.parse(
(await execa("git", ["notes", "--ref", `${GIT_NOTE_REF}-${ref}`, "show", ref], execaOptions).catch(handleError))
.stdout
)
);
} catch (error) {
if (error.exitCode === 1) {
return {};
@@ -327,5 +342,19 @@ export async function getNote(ref, execaOptions) {
* @param {Object} [execaOpts] Options to pass to `execa`.
*/
export async function addNote(note, ref, execaOptions) {
await execa("git", ["notes", "--ref", GIT_NOTE_REF, "add", "-f", "-m", JSON.stringify(note), ref], execaOptions);
await execa(
"git",
["notes", "--ref", `${GIT_NOTE_REF}-${ref}`, "add", "-f", "-m", JSON.stringify(note), ref],
execaOptions
);
}
/**
* Get the reference of a tag
*
* @param {String} tag The tag name to get the reference of.
* @param {Object} [execaOpts] Options to pass to `execa`.
**/
export async function getTagRef(tag, execaOptions) {
return (await execa("git", ["show-ref", tag, "--hash"], execaOptions)).stdout;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

+2253 -2180
View File
File diff suppressed because it is too large Load Diff
+21 -20
View File
@@ -33,9 +33,9 @@
"@semantic-release/npm": "^11.0.0",
"@semantic-release/release-notes-generator": "^12.0.0",
"aggregate-error": "^5.0.0",
"cosmiconfig": "^8.0.0",
"cosmiconfig": "^9.0.0",
"debug": "^4.0.0",
"env-ci": "^10.0.0",
"env-ci": "^11.0.0",
"execa": "^8.0.0",
"figures": "^6.0.0",
"find-versions": "^5.1.0",
@@ -43,13 +43,14 @@
"git-log-parser": "^1.2.0",
"hook-std": "^3.0.0",
"hosted-git-info": "^7.0.0",
"import-from-esm": "^1.3.1",
"lodash-es": "^4.17.21",
"marked": "^9.0.0",
"marked-terminal": "^6.0.0",
"marked": "^11.0.0",
"marked-terminal": "^7.0.0",
"micromatch": "^4.0.2",
"p-each-series": "^3.0.0",
"p-reduce": "^3.0.0",
"read-pkg-up": "^10.0.0",
"read-pkg-up": "^11.0.0",
"resolve-from": "^5.0.0",
"semver": "^7.3.2",
"semver-diff": "^4.0.0",
@@ -57,31 +58,31 @@
"yargs": "^17.5.1"
},
"devDependencies": {
"ava": "5.3.1",
"c8": "8.0.1",
"ava": "6.1.1",
"c8": "9.1.0",
"clear-module": "4.1.2",
"codecov": "3.8.3",
"cz-conventional-changelog": "3.3.0",
"dockerode": "4.0.0",
"dockerode": "4.0.2",
"file-url": "4.0.0",
"fs-extra": "11.1.1",
"got": "13.0.0",
"fs-extra": "11.2.0",
"got": "14.2.0",
"js-yaml": "4.1.0",
"lockfile-lint": "4.12.1",
"ls-engines": "0.9.0",
"ls-engines": "0.9.1",
"mockserver-client": "5.15.0",
"nock": "13.3.7",
"npm-run-all2": "6.1.1",
"p-retry": "6.1.0",
"prettier": "3.0.3",
"publint": "0.2.5",
"sinon": "17.0.0",
"nock": "13.5.1",
"npm-run-all2": "6.1.2",
"p-retry": "6.2.0",
"prettier": "3.2.4",
"publint": "0.2.7",
"sinon": "17.0.1",
"stream-buffers": "3.0.2",
"tempy": "3.1.0",
"testdouble": "3.20.0"
"testdouble": "3.20.1"
},
"engines": {
"node": "^18.17 || >=20.6.1"
"node": ">=20.8.1"
},
"files": [
"bin",
@@ -158,7 +159,7 @@
},
"renovate": {
"extends": [
"github>semantic-release/.github"
"github>semantic-release/.github:renovate-config"
]
}
}
+86
View File
@@ -389,6 +389,92 @@ test.serial('Read configuration from an array of paths in "extends"', async (t)
t.deepEqual(result, { options: expectedOptions, plugins: pluginsConfig });
});
test.serial('Read configuration from an array of CJS files in "extends"', async (t) => {
// Create a git repository, set the current working directory at the root of the repo
const { cwd } = await gitRepo();
const pkgOptions = { extends: ["./shareable1.cjs", "./shareable2.cjs"] };
const options1 = {
verifyRelease: "verifyRelease1",
analyzeCommits: { path: "analyzeCommits1", param: "analyzeCommits_param1" },
branches: ["test_branch"],
repositoryUrl: "https://host.null/owner/module.git",
};
const options2 = {
verifyRelease: "verifyRelease2",
generateNotes: "generateNotes2",
analyzeCommits: { path: "analyzeCommits2", param: "analyzeCommits_param2" },
branches: ["test_branch"],
tagFormat: `v\${version}`,
plugins: false,
};
// Create package.json and shareable.json in repository root
await outputJson(path.resolve(cwd, "package.json"), { release: pkgOptions });
await writeFile(path.resolve(cwd, "shareable1.cjs"), `module.exports = ${JSON.stringify(options1)}`);
await writeFile(path.resolve(cwd, "shareable2.cjs"), `module.exports = ${JSON.stringify(options2)}`);
const expectedOptions = { ...options1, ...options2, branches: ["test_branch"] };
// Verify the plugins module is called with the plugin options from shareable1.mjs and shareable2.mjs
td.when(
plugins(
{ options: expectedOptions, cwd },
{
verifyRelease1: "./shareable1.cjs",
verifyRelease2: "./shareable2.cjs",
generateNotes2: "./shareable2.cjs",
analyzeCommits1: "./shareable1.cjs",
analyzeCommits2: "./shareable2.cjs",
}
)
).thenResolve(pluginsConfig);
const result = await t.context.getConfig({ cwd });
// Verify the options contains the plugin config from shareable1.json and shareable2.json
t.deepEqual(result, { options: expectedOptions, plugins: pluginsConfig });
});
test.serial('Read configuration from an array of ESM files in "extends"', async (t) => {
// Create a git repository, set the current working directory at the root of the repo
const { cwd } = await gitRepo();
const pkgOptions = { extends: ["./shareable1.mjs", "./shareable2.mjs"] };
const options1 = {
verifyRelease: "verifyRelease1",
analyzeCommits: { path: "analyzeCommits1", param: "analyzeCommits_param1" },
branches: ["test_branch"],
repositoryUrl: "https://host.null/owner/module.git",
};
const options2 = {
verifyRelease: "verifyRelease2",
generateNotes: "generateNotes2",
analyzeCommits: { path: "analyzeCommits2", param: "analyzeCommits_param2" },
branches: ["test_branch"],
tagFormat: `v\${version}`,
plugins: false,
};
// Create package.json and shareable.json in repository root
await outputJson(path.resolve(cwd, "package.json"), { release: pkgOptions });
await writeFile(path.resolve(cwd, "shareable1.mjs"), `export default ${JSON.stringify(options1)}`);
await writeFile(path.resolve(cwd, "shareable2.mjs"), `export default ${JSON.stringify(options2)}`);
const expectedOptions = { ...options1, ...options2, branches: ["test_branch"] };
// Verify the plugins module is called with the plugin options from shareable1.mjs and shareable2.mjs
td.when(
plugins(
{ options: expectedOptions, cwd },
{
verifyRelease1: "./shareable1.mjs",
verifyRelease2: "./shareable2.mjs",
generateNotes2: "./shareable2.mjs",
analyzeCommits1: "./shareable1.mjs",
analyzeCommits2: "./shareable2.mjs",
}
)
).thenResolve(pluginsConfig);
const result = await t.context.getConfig({ cwd });
// Verify the options contains the plugin config from shareable1.json and shareable2.json
t.deepEqual(result, { options: expectedOptions, plugins: pluginsConfig });
});
test.serial('Prioritize configuration from config file over "extends"', async (t) => {
// Create a git repository, set the current working directory at the root of the repo
const { cwd } = await gitRepo();
+4 -4
View File
@@ -98,7 +98,7 @@ export async function gitCommits(messages, execaOptions) {
/**
* Get the list of parsed commits since a git reference.
*
* @param {String} [from] Git reference from which to seach commits.
* @param {String} [from] Git reference from which to search commits.
* @param {Object} [execaOpts] Options to pass to `execa`.
*
* @return {Array<Object>} The list of parsed commits.
@@ -240,7 +240,7 @@ export async function gitTagHead(tagName, execaOptions) {
* Get the first commit sha referenced by the tag `tagName` in the remote repository.
*
* @param {String} repositoryUrl The repository remote URL.
* @param {String} tagName The tag name to seach for.
* @param {String} tagName The tag name to search for.
* @param {Object} [execaOpts] Options to pass to `execa`.
*
* @return {String} The sha of the commit associated with `tagName` on the remote repository.
@@ -315,7 +315,7 @@ export async function rebase(ref, execaOptions) {
* @param {Object} [execaOpts] Options to pass to `execa`.
*/
export async function gitAddNote(note, ref, execaOptions) {
await execa("git", ["notes", "--ref", GIT_NOTE_REF, "add", "-m", note, ref], execaOptions);
await execa("git", ["notes", "--ref", `${GIT_NOTE_REF}-${ref}`, "add", "-m", note, ref], execaOptions);
}
/**
@@ -325,5 +325,5 @@ export async function gitAddNote(note, ref, execaOptions) {
* @param {Object} [execaOpts] Options to pass to `execa`.
*/
export async function gitGetNote(ref, execaOptions) {
return (await execa("git", ["notes", "--ref", GIT_NOTE_REF, "show", ref], execaOptions)).stdout;
return (await execa("git", ["notes", "--ref", `${GIT_NOTE_REF}-${ref}`, "show", ref], execaOptions)).stdout;
}
+1 -1
View File
@@ -11,7 +11,7 @@ test("Replace multiple sensitive environment variable values", (t) => {
);
});
test("Replace multiple occurences of sensitive environment variable values", (t) => {
test("Replace multiple occurrences of sensitive environment variable values", (t) => {
const env = { secretKey: "secret" };
t.is(
hideSensitive(env)(`https://user:${env.secretKey}@host.com?token=${env.secretKey}`),
+1 -1
View File
@@ -96,7 +96,7 @@ test("Normalize and load plugin from function", async (t) => {
t.is(typeof plugin, "function");
});
test("Normalize and load plugin that retuns multiple functions", async (t) => {
test("Normalize and load plugin that returns multiple functions", async (t) => {
const plugin = await normalize(
{ cwd, options: {}, logger: t.context.logger },
"verifyConditions",
+2 -2
View File
@@ -52,7 +52,7 @@ test("validateStep: optional plugin configuration", (t) => {
t.true(validateStep(type, { path: () => {}, options: "value" }));
t.false(validateStep(type, { path: null }));
// Considered as an Array of 2 definitions and not as one Array definition in case of a muliple plugin type
// Considered as an Array of 2 definitions and not as one Array definition in case of a multiple plugin type
t.false(validateStep(type, [() => {}, { options: "value" }]));
t.false(validateStep(type, ["plugin-path.js", { options: "value" }]));
@@ -134,7 +134,7 @@ test("validateStep: required plugin configuration", (t) => {
t.true(validateStep(type, { path: () => {}, options: "value" }));
t.false(validateStep(type, { path: null }));
// Considered as an Array of 2 definitions and not as one Array definition in the case of a muliple plugin type
// Considered as an Array of 2 definitions and not as one Array definition in the case of a multiple plugin type
t.false(validateStep(type, [() => {}, { options: "value" }]));
t.false(validateStep(type, ["plugin-path.js", { options: "value" }]));