63 Commits

Author SHA1 Message Date
Matt Travi
e623cc642a
feat(node-versions): raised the minimum node v20 requirement to v20.6
for auto-registered loader support

BREAKING CHANGE: the minimum supported node version in the v20 major range is now v20.6
2023-09-16 11:52:49 -05:00
Matt Travi
e39ae90ae2
test(integration): properly waited for the image pulls to complete (#2842) 2023-06-25 17:51:31 -07:00
Matt Travi
ab4fe4c3d4
refactor: leverage native async setTimeout rather than delay 2023-05-22 22:25:22 -05:00
Chris. Webster
c71d5d94ce
test: Windows support in integration tests (#2722)
* ci: win32 escape slash as doubleslash for test

Pathing in stderr output has double backslash in the filename.  The test
will now use double backslash in the existence test.

Signed-off-by: Chris. Webster <chris@webstech.net>

* ci: avoid Windows pop-up in credential tests

Windows uses a `credential.helper` that will open a pop-up for
credentials if they are missing.  A git config parameter will now be set
to avoid the pop-up.

Signed-off-by: Chris. Webster <chris@webstech.net>

---------

Signed-off-by: Chris. Webster <chris@webstech.net>
2023-03-04 12:37:05 -06:00
Chris. Webster
f991a599f5
test(integration): fix package name conflict (#2719) 2023-02-27 22:01:57 -06:00
Matt Travi
d170f73e0b
feat(plugins): add support for loading ESM plugins (#2688)
Co-authored-by: Matt Travi <programmer@travi.org>
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
2023-01-24 23:24:02 -06:00
Matt Travi
caa8b95f7b
test(integration): used token auth for registry interactions rather than legacy auth 2022-12-17 22:53:11 -06:00
Matt Travi
6051fae63f
Revert "test(integration): ran tests serially in hope of avoiding conflicts in the ci environment"
This reverts commit 71f45f97b11dcd87c90834ecd1da78bc340cc5c6.
2022-12-02 16:42:21 -06:00
Matt Travi
62846a110b
test(integration): omitted the GITHUB_ACTION env var as well 2022-12-02 16:35:57 -06:00
Matt Travi
71f45f97b1
test(integration): ran tests serially in hope of avoiding conflicts in the ci environment 2022-12-02 14:44:29 -06:00
Matt Travi
f32fd5889a
test(integration): updated the simulated environment to omit the GITHUB_ACTIONS variable from the test env 2022-12-02 14:20:04 -06:00
Gregor Martynus
d13ea9280e
style: prettier (#2624) 2022-11-23 16:02:51 -08:00
Matt Travi
f7c85e3fff
test(index): forced plugins to use semantic-release beta
which deduped env-ci to the esm-only version, allowing test double to stub properly
2022-11-11 11:01:16 -06:00
Matt Travi
9eab1adb9d
feat(esm): convert to esm (#2569)
for #2543

BREAKING CHANGE: semantic-release is now ESM-only. since it is used through its own executable, the impact on consuming projects should be minimal

BREAKING CHANGE: references to plugin files in configs need to include the file extension because of executing in an ESM context
2022-11-11 09:24:06 -06:00
Matt Travi
9a513a38f7
test: replaced proxyquire with testdouble (#2537)
for #2133

Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
2022-08-26 09:32:52 -07:00
Gregor Martynus
b5aa853b22
ci: replace travis with actions, setup renovate (#1699)
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2021-01-20 14:07:16 -08:00
Arthur Chaloin
2bf377194e
fix: use valid git credentials when multiple are provided (#1669) 2020-10-29 11:09:19 -07:00
Gregor Martynus
caa3526caa style: xo 2020-04-08 15:13:33 -07:00
greenkeeper[bot]
ef1b8a0b91 chore(package): update ava to version 3.1.0 2020-01-27 13:52:59 -05:00
Pierre Vanduynslager
b2c1b2c670 feat: use Git notes to store the channels on which a version has been released
BREAKING CHANGE: this feature change the way semantic-release keep track of the channels on which a version has been released.
It now use a JSON object stored in a [Git note](https://git-scm.com/docs/git-notes) instead of Git tags formatted as v{version}@{channel}.

The tags formatted as v{version}@{channel} will now be ignored. If you have made releases with v16.0.0 on branches other than the default one you will have to update your repository.

The changes to make consist in:
- Finding all the versions that have been released on a branch other than the default one by searching for all tags formatted v{version}@{channel}
- For each of those version:
  - Create a tag without the {@channel} if none doesn't already exists
  - Add a Git note to the tag without the {@channel} containing the channels on which the version was released formatted as `{"channels":["channel1","channel2"]}` and using `null` for the default channel (for example.`{"channels":[null,"channel1","channel2"]}`)
  - Push the tags and notes
  - Update the GitHub releases that refer to a tag formatted as v{version}@{channel} to use the tag without it
  - Delete the tags formatted as v{version}@{channel}
2019-12-02 23:38:40 -05:00
Pierre Vanduynslager
aec96c791f fix: correctly determine release to add to a channel
- Add only the most recent release to a channel (rather than adding all the one not added yet)
- Avoid attempting to ad the version twice in case that version is already present in multiple upper branches
2019-11-27 15:18:23 -05:00
Pierre Vanduynslager
fa62d0ba0b
revert: fix: revert to execa ^1.0.0
This reverts commit 6b3adf6bbe72d5c32335118e91ca32ec043bbc9e.
2019-09-13 17:09:03 -04:00
greenkeeper[bot]
ba00e16f43 chore(package): update ava to version 1.0.1 2018-12-27 15:04:57 -05:00
Pierre Vanduynslager
7b4052470b feat: support multiple branches and distribution channels
- Allow to configure multiple branches to release from
- Allow to define a distribution channel associated with each branch
- Manage the availability on distribution channels based on git merges
- Support regular releases, maintenance releases and pre-releases
- Add the `addChannel` plugin step to make an existing release available on a different distribution channel

BREAKING CHANGE: the `branch` option has been removed in favor of `branches`

The new `branches` option expect either an Array or a single branch definition. To migrate your configuration:
- If you want to publish package from multiple branches, please the configuration documentation
- If you use the default configuration and want to publish only from `master`: nothing to change
- If you use the `branch` configuration and want to publish only from one branch: replace `branch` by `branches` (`"branch": "my-release-branch"` => `"branches": "my-release-branch"`)
2018-11-29 14:13:03 -05:00
Pierre Vanduynslager
9f5645cfa0 refactor: harmonize git utils function names 2018-11-19 18:34:16 -05:00
Pierre Vanduynslager
cfeaf49233 test: use real writable stream
This way plugins can pipe a stream to `stdout` and `stderr` in integration tests.
2018-08-15 16:27:55 -04:00
Pierre Vanduynslager
0626d57116 feat: log with signale and allow to customize stdin and stdout 2018-07-29 21:56:21 -04:00
Pierre Vanduynslager
1d4f67e5e8 test: use semanticrelease/npm-registry-docker Docker image for tests 2018-07-29 21:48:35 -04:00
Pierre Vanduynslager
a94e08de9a feat: pass cwd and env context to plugins
- Allow to run semantic-release (via API) from anywhere passing the current working directory.
- Allows to simplify the tests and to run them in parallel in both the core and plugins.
2018-07-17 00:42:04 -04:00
Pierre Vanduynslager
50061bb267 refactor: remove unnecessary object destructuring 2018-07-10 13:18:58 -04:00
Pierre Vanduynslager
2d3a5e53e9 test: harmonize git-utils functions name 2018-07-02 18:38:24 -04:00
Pierre Vanduynslager
2b6378f26f fix: use git ls-remote to verify if the remote branch is ahead 2018-06-15 16:16:55 -04:00
Pierre Vanduynslager
b0b4fc82de fix: convert git+https URL in package.json to https 2018-03-13 00:54:32 +00:00
Pierre Vanduynslager
305f4ee8eb fix: do not transform repositoryUrl if it allow to push
Even the user set Git credentials via environment variable, use the configured URL (with authentication) if it works.
This allow users to push tags and commits via ssh while still using the GitHub/GitLab API.
2018-02-14 10:45:44 -05:00
Pierre Vanduynslager
97cb354fea feat: improve CLI
- Replace `commander.js` with `yargs`
- Add CLI unit tests
- Add a `--version` option
- Improve `--help` output
- Remove `commander.js` related workaround
- Allow to set list option with arg repetition or space separated list
- Maintain the list options defined as comma separated list
2018-02-12 11:01:09 -08:00
Pierre Vanduynslager
49f5e704ba feat: add success and fail notification plugins
- Allow `publish` plugins to return an `Object` with information related to the releases
- Add the `success` plugin hook, called when all `publish` are successful, receiving a list of release
- Add the `fail` plugin hook, called when an error happens at any point, receiving a list of errors
- Add detailed message for each error
2018-02-11 19:53:41 -05:00
Pierre Vanduynslager
d0b304e240 feat: get last release with git tags
- Remove the `getLastRelease` plugin type
- Retrieve the last release based on Git tags
- Create the next release Git tag before calling the `publish` plugins

BREAKING CHANGE: Remove the `getLastRelease` plugin type

The `getLastRelease` plugins will not be called anymore.

BREAKING CHANGE: Git repository authentication is now mandatory

The Git authentication is now mandatory and must be set via `GH_TOKEN`, `GITHUB_TOKEN`,  `GL_TOKEN`, `GITLAB_TOKEN` or `GIT_CREDENTIALS` as described in [CI configuration](https://github.com/semantic-release/semantic-release/blob/caribou/docs/usage/ci-configuration.md#authentication).
2018-01-27 16:50:29 -05:00
Pierre Vanduynslager
fb0caa005b feat: hide sensitive info in stdout/sdtin 2018-01-27 14:00:06 -05:00
Pierre Vanduynslager
0d2d1f2376 fix: fix the --no-ci arg parsing
The `noCi` is no properly set based on the `--no-ci` CLI arg and it is overwritten by the `noCi` option
2018-01-24 22:22:16 -08:00
Pierre Vanduynslager
5cc62e49ee test: add missing mockserver mocks 2018-01-01 20:20:19 -05:00
Pierre Vanduynslager
95de6a5c80 test: update test for @semantic-release/github@3.0.1 2018-01-01 20:20:19 -05:00
Pierre Vanduynslager
8d575654c2 feat: make semantic-release CI agnostic
- Remove `@semantic-release/condition-travis` from the default plugins
- Verify the current branch in the core
- Verify the build is not triggered by a PR in the core
- Run in dry-run mode if not triggered on CI
- Dry-run mode runs the `verifyConditions` plugins, allowing to detect configuration error locally
- Return without error when no version has to be released due to no changes
- Return without error if the build is triggered from a PR
- Return without error if the current branch is not the configured branch
- CLI return with exit code 1 if there is a `semanticReleaseError`, allowing to fail builds in case of config error, missing token etc...

BREAKING CHANGE: `semantic-release` doesn't make sure it runs only on one Travis job anymore.
The CI configuration has to be done such that `semantic-release`
- runs only once per build
- runs only after all tests are successful on every jobs of the build
- runs on Node >=8

This can easily be done with [travis-deploy-once](https://github.com/semantic-release/travis-deploy-once).

Migration Guide

Modify your `.travis.yml` to use `travis-deploy-once`.
Replace:
```yaml
after_success:
  - npm run semantic-release
```
by:
Replace
```yaml
after_success:
  - npm install -g travis-deploy-once@4
  - travis-deploy-once "npm run semantic-release"
```
2017-12-30 23:15:25 -05:00
Pierre Vanduynslager
996305d69c feat: move npm workaround for missing gitHead to the npm plugin 2017-12-30 21:17:04 -05:00
Pierre Vanduynslager
754b420fd6 feat: support sharable configuration
Adds the options `extends`, which can be defined via configuration file or CLI arguments to a single path or an array of paths of shareable configuration.
A shareable configuration is a file or a module that can be loaded with `require`.
Options is defined by merging in the following order of priority:
- CLI/API
- Configuration file
- Shareable configuration (from right to left)

Options set in a shareable configuration can be unset by setting it to `null` or `undefined` in the main configuration file. If a default value applies to this property it will be used.
2017-12-22 14:22:30 -05:00
greenkeeper[bot]
d28b7e3e07 fix(package): update @semantic-release/github to version 3.0.0 2017-12-22 13:26:00 -05:00
Pierre Vanduynslager
8942093c18 test: limit information stored in context
Store only objects set in `beforeEach` used in `test`.
Avoid logging useless info on test failure.
2017-12-14 11:44:24 -05:00
Pierre Vanduynslager
0761ef378a style: update to prettier@1.9.0 2017-12-05 10:03:18 -05:00
Pierre Vanduynslager
eec4e68615 test: Isolate environment variables passed to semantic-release
`npm` is called through `semantic-release` and in the integration test to make some assertion.
By isolating the the environment variables passed to `semantic-release` it's easier to avoid a mistake that would pass the test environment that contains is own auth variables.
2017-11-29 18:06:14 -05:00
Pierre Vanduynslager
ce3841f553 test: Ignore the ~/.npmrc file during tests
When the test are run npm read the ~/.npmrc and ./.npmrc files and set some environment variables starting with `npm_`.
When the test create temporary folders and created a `.npmrc` the values there are ignored as the environment variables take precedence.
This commit remove this environment variable (from the local `process.env`) before starting the integrations test and restore them after. This way the `./.npmrc` files created in temp directory for the test are correctly used.
2017-11-25 14:50:44 -05:00
Pierre Vanduynslager
40c58c9b42 ci: Run npm registry in Docker 2017-11-25 14:50:44 -05:00