Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: semantic-release/semantic-release
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v17.4.4
Choose a base ref
...
head repository: semantic-release/semantic-release
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v17.4.5
Choose a head ref
  • 11 commits
  • 9 files changed
  • 8 contributors

Commits on Jun 25, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1463eb4 View commit details

Commits on Jul 1, 2021

  1. docs(recipes): fix some typos (#1999)

    Signed-off-by: Moritz Wiesinger <[email protected]>
    mowies authored Jul 1, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cf00068 View commit details

Commits on Jul 2, 2021

  1. chore(deps): update dependency js-yaml to v4 (#1752)

    Co-authored-by: Renovate Bot <[email protected]>
    Co-authored-by: Matt Travi <[email protected]>
    3 people authored Jul 2, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    143c898 View commit details

Commits on Jul 8, 2021

  1. docs(circleci): Update CircleCI recipes config (#2018)

    Updates the included CircleCI config file example.
    
    * Now uses 2.1 style config
    * Uses Node Orb
    * Use pre-defined node/test job
    * Uses Matrix jobs to test multiple node versions.
    * Updated Node versions
    * Using new CircleCI docker images (from node executor)
    * Updated language/terminology in description
    KyleTryon authored Jul 8, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    413ffd2 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fa847e2 View commit details

Commits on Jul 17, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    04b6046 View commit details

Commits on Jul 18, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ee3068e View commit details

Commits on Jul 19, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a4f0ff7 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    88e423b View commit details

Commits on Aug 12, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ebad322 View commit details

Commits on Aug 16, 2021

  1. fix(deps): update dependency marked to v3

    Co-authored-by: Renovate Bot <[email protected]>
    renovate[bot] and renovate-bot authored Aug 16, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6e4beb8 View commit details
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -14,7 +14,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: bahmutov/npm-install@v1
with:
cache: npm
- run: npm ci
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 5 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -31,9 +31,10 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Ensure dependencies are compatible with the version of node
run: echo 'engine-strict=true' >> .npmrc
- uses: bahmutov/npm-install@v1
- run: npm ci
- run: npm run test:ci

# separate job to set as required in branch protection,
@@ -44,5 +45,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: bahmutov/npm-install@v1
with:
cache: npm
- run: npm ci
- run: npm run lint
39 changes: 16 additions & 23 deletions docs/recipes/circleci-workflows.md
Original file line number Diff line number Diff line change
@@ -10,46 +10,39 @@ Alternatively, the default `NPM_TOKEN` and `GH_TOKEN` can be easily [setup with

### `.circleci/config.yml` configuration for multiple Node jobs

This example is a minimal configuration for **semantic-release** with a build running Node 6 and 8. See [CircleCI documentation](https://circleci.com/docs/2.0) for additional configuration options.
This example is a minimal configuration for **semantic-release** with tests running against Node 16 and 14. See [CircleCI documentation](https://circleci.com/docs/2.0) for additional configuration options.

This example create the workflows `test_node_4`, `test_node_6`, `test_node_8` and `release`. The release workflows will [run `semantic-release` only after the all the `test_node_*` are successful](../usage/ci-configuration.md#run-semantic-release-only-after-all-tests-succeeded).
In this example, the [`circleci/node`](https://circleci.com/developer/orbs/orb/circleci/node) orb is imported (Which makes some node operations easier), then a `release` job is defined which will run `semantic-release`.

To run our `release` job, we have created a workflow named `test_and_release` which will run two jobs, `node/test`, which comes from the node orb and will test our application, and our release job. Here, we are actually making use of [matrix jobs](https://circleci.com/blog/circleci-matrix-jobs/) so that our single `node/test` job will actually be executed twice, once for Node version 16, and once for version 14. Finally, we call our release job with a `requires` parameter so that `release` will only run after `node/test` has successfully tested against v14 and v16.

```yaml
version: 2
version: 2.1
orbs:
node: circleci/node@4.5
jobs:
test_node_6:
docker:
- image: circleci/node:6
steps:
# Configure your test steps here (checkout, npm install, cache management, tests etc...)

test_node_8:
docker:
- image: circleci/node:8
steps:
# Configure your test steps here (checkout, npm install, cache management, tests etc...)

release:
docker:
- image: circleci/node:8
executor: node/default
steps:
- checkout
- run: npm install
- node/install-packages # Install and automatically cache packages
# Run optional required steps before releasing
# - run: npm run build-script
- run: npx semantic-release

workflows:
version: 2
test_and_release:
# Run the test jobs first, then the release only when all the test jobs are successful
jobs:
- test_node_6
- test_node_8
- node/test:
matrix:
parameters:
version:
- 16.1.0
- 14.7.0
- release:
requires:
- test_node_6
- test_node_8
- node/test
```
### `package.json` configuration for multiple Node jobs
4 changes: 2 additions & 2 deletions docs/recipes/maintenance-releases.md
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ The Git history of the repository is now:

One of our users request a new feature, however they cannot migrate to Node.js 8 or higher due to corporate policies.

If we were to push that feature on `master` and release it, the new version would require Node.js 8 or higher as the release would also contains the commit `feat: drop Node.js 6 support \n\n BREAKING CHANGE: Node.js >= 8 required`.
If we were to push that feature on `master` and release it, the new version would require Node.js 8 or higher as the release would also contain the commit `feat: drop Node.js 6 support \n\n BREAKING CHANGE: Node.js >= 8 required`.

Instead, we create the branch `1.x` from the tag `v1.0.0` with the command `git checkout -b 1.x v1.0.0` and we commit that feature with the message `feat: a feature` to the branch `1.x`. When pushing that commit, **semantic-release** will release the version `1.1.0` on the dist-tag `@release-1.x` so users who can't migrate to Node.js 8 or higher can benefit from it.

@@ -48,7 +48,7 @@ The Git history of the repository is now:

## Releasing a bug fix for version 1.0.x users

Another user currently using version `1.0.0` reports a bug. They cannot migrate to Node.js 8 or higher and they also cannot migrate to `1.1.0` as they do not use the feature developed in `feat: a feature` and their corporate policies require to go through a costly quality insurance process for each `minor` upgrades.
Another user currently using version `1.0.0` reports a bug. They cannot migrate to Node.js 8 or higher and they also cannot migrate to `1.1.0` as they do not use the feature developed in `feat: a feature` and their corporate policies require to go through a costly quality assurance process for each `minor` upgrades.

In order to deliver the bug fix in a `patch` release, we create the branch `1.0.x` from the tag `v1.0.0` with the command `git checkout -b 1.0.x v1.0.0` and we commit that fix with the message `fix: a fix` to the branch `1.0.x`. When pushing that commit, **semantic-release** will release the version `1.0.1` on the dist-tag `@release-1.0.x` so users who can't migrate to `1.1.x` or `2.x` can benefit from it.

4 changes: 4 additions & 0 deletions docs/usage/plugins.md
Original file line number Diff line number Diff line change
@@ -16,6 +16,8 @@ A plugin is a npm module that can implement one or more of the following steps:
| `success` | No | Responsible for notifying of a new release. |
| `fail` | No | Responsible for notifying of a failed release. |

Release steps will run in that order. At each step, **semantic-release** will run every plugin in the [`plugins` array](#plugins-declaration-and-execution-order), as long as the plugin implements the step.

**Note:** If no plugin with a `analyzeCommits` step is defined `@semantic-release/commit-analyzer` will be used.

## Plugins installation
@@ -70,6 +72,8 @@ With this configuration **semantic-release** will:
- execute the `prepare` implementation of `@semantic-release/npm` then `@semantic-release/git`
- execute the `publish` implementation of `@semantic-release/npm`

Order is first determined by release steps (such as `verifyConditions``anayzeCommits`). At each release step, plugins are executed in the order in which they are defined.

## Plugin options configuration

A plugin configuration can be specified by wrapping the name and an options object in an array. Options configured this way will be passed only to that specific plugin.
4 changes: 2 additions & 2 deletions docs/usage/workflow-configuration.md
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ Each branch can be defined either as a string, a [glob](https://github.com/micro

A branch can defined as one of three types:
- [release](#release-branches): to make releases on top of the last version released
- [maintenance](#maintenance-branches): to make release on top of an old release
- [maintenance](#maintenance-branches): to make releases on top of an old release
- [pre-release](#pre-release-branches): to make pre-releases

The type of the branch is automatically determined based on naming convention and/or [properties](#branches-properties).
@@ -25,7 +25,7 @@ The type of the branch is automatically determined based on naming convention an
| `name` | All | **Required.** The Git branch holding the commits to analyze and the code to release. See [name](#name). | - The value itself if defined as a `String` or the matching branches name if defined as a glob. |
| `channel` | All | The distribution channel on which to publish releases from this branch. Set to `false` to force the default distribution channel instead of using the default. See [channel](#channel). | `undefined` for the first release branch, the value of `name` for subsequent ones. |
| `range` | [maintenance](#maintenance-branches) only | **Required unless `name` is formatted like `N.N.x` or `N.x` (`N` is a number).** The range of [semantic versions](https://semver.org) to support on this branch. See [range](#range). | The value of `name`. |
| `prerelease` | [pre-release](#pre-release-branches) only | **Required.** The pre-release detonation to append to [semantic versions](https://semver.org) released from this branch. See [prerelease](#prerelease). | - |
| `prerelease` | [pre-release](#pre-release-branches) only | **Required.** The pre-release denotation to append to [semantic versions](https://semver.org) released from this branch. See [prerelease](#prerelease). | - |

### name

97 changes: 78 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@
"hook-std": "^2.0.0",
"hosted-git-info": "^4.0.0",
"lodash": "^4.17.21",
"marked": "^2.0.0",
"marked": "^3.0.0",
"marked-terminal": "^4.1.1",
"micromatch": "^4.0.2",
"p-each-series": "^2.1.0",
@@ -58,11 +58,11 @@
"file-url": "3.0.0",
"fs-extra": "10.0.0",
"got": "11.8.2",
"js-yaml": "3.14.1",
"js-yaml": "4.1.0",
"mockserver-client": "5.11.2",
"nock": "13.1.0",
"nock": "13.1.1",
"nyc": "15.1.0",
"p-retry": "4.5.0",
"p-retry": "4.6.1",
"proxyquire": "2.1.3",
"sinon": "11.1.1",
"stream-buffers": "3.0.2",
2 changes: 1 addition & 1 deletion test/get-config.test.js
Original file line number Diff line number Diff line change
@@ -136,7 +136,7 @@ test('Read options from .releaserc.yml', async (t) => {
plugins: false,
};
// Create package.json in repository root
await writeFile(path.resolve(cwd, '.releaserc.yml'), yaml.safeDump(options));
await writeFile(path.resolve(cwd, '.releaserc.yml'), yaml.dump(options));

const {options: result} = await t.context.getConfig({cwd});