Skip to content

Commit

Permalink
Merge branch 'v13'
Browse files Browse the repository at this point in the history
# Conflicts:
#	lib/plugin/git/Git.js
#	package.json
  • Loading branch information
webpro committed Mar 7, 2020
2 parents a53118e + e581d56 commit ba97a5c
Show file tree
Hide file tree
Showing 40 changed files with 362 additions and 433 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,29 @@
name: Cross-OS Tests

on: [push, pull_request]

env:
GITHUB_TOKEN: 1
GITLAB_TOKEN: 1

jobs:
test:
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
node:
- 10
- 12

runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} (Node v${{ matrix.node }})

steps:
- uses: actions/checkout@v2
- run: git config --global user.name User
- run: git config --global user.email user@example.org
- run: npm install
- run: npm test
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

16 changes: 13 additions & 3 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,14 @@ This document lists breaking changes for each major release.
See the GitHub Releases page for detailed changelogs:
[https://github.com/release-it/release-it/releases](https://github.com/release-it/release-it/releases)

## v13

- Dropped support for Node v8
- Dropped support for GitLab v11.6 and lower.
- Deprecated `scripts` are removed (in favor of [hooks](https://github.com/release-it/release-it#hooks)).
- Removed deprecated `--non-interactive` (`-n`) argument. Use `--ci` instead.
- Removed old `%s` and `[REV_RANGE]` syntax in command substitutions. Use `${version}` and `${latestTag}` instead.

## v12

- The `--follow-tags` argument for `git push` has been moved to the default configuration. This is only a breaking
Expand All @@ -14,7 +22,8 @@ See the GitHub Releases page for detailed changelogs:

- The custom `conventional-changelog` increment (e.g. `"increment": "conventional:angular"`) with additional script
configuration is replaced with a plugin. Please see
[conventional changelog](https://github.com/release-it/release-it#conventional-changelog) how to use this plugin.
[conventional changelog](https://github.com/release-it/release-it/blob/master/docs/changelog.md#conventional-changelog)
how to use this plugin.
- The `pkgFiles` option has been removed. If there's a need to bump other files than what `npm version` bumps, it should
be (part of) a plugin.
- By default, the latest version was derived from the latest Git tag. From v11, if the repo has a `package.json` then
Expand All @@ -26,15 +35,16 @@ See the GitHub Releases page for detailed changelogs:

- Dropped support for Node v6
- Deprecated options from v9 are removed, the `dist.repo` config in particular (also see
[distribution repository](https://github.com/release-it/release-it#distribution-repository) for alternatives).
[distribution repository](https://github.com/release-it/release-it/blob/master/docs/recipes/distribution-repo.md) for
alternatives).
- Drop the `--debug` flag. `DEBUG=release-it:* ...` still works.

## v9

There should be no breaking changes, but there have been major internal refactorings and an improved UI. A bunch of new
features and bug fixes have been implemented. Last but not least, the configuration structure is changed significantly.
For this (backwards compatible) change, deprecation warnings are shown, and configurations must be migrated with the
next major release (v10). See [deprecated.json](./conf/deprecated.json) for the changes, mainly:
next major release (v10). See [deprecated.json](./config/deprecated.json) for the changes, mainly:

- All "command hooks" have been moved to `scripts.*`, and some have been renamed.
- All `src.*` options have been moved to `git.*` (and `scripts.*`).
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -52,8 +52,8 @@ Please keep the following in mind:
- To match the existing code styling, use `npm run format` before committing code.
- Make sure the tests pass (run `npm test`). Your changes probably deserve new tests as well.
- Remember that this project is cross-platform compatible (macOS, Windows, Linux), and that it runs in different
versions of Node. On PR submission, [Travis CI](https://travis-ci.org/release-it/release-it) will run the tests in
multiple supported platforms and Node.js versions.
versions of Node. On PR submission, a [GitHub Action](https://github.com/release-it/release-it/actions) will run the
tests in multiple supported platforms and Node.js versions.

Unsure about whether you should open a pull request? Feel free to discuss it first in a ticket.

Expand Down
37 changes: 5 additions & 32 deletions README.md
Expand Up @@ -15,7 +15,7 @@
- Extend with [plugins](#plugins)
- Release from any [CI/CD environment](./docs/ci.md)

[![Build Status](https://api.travis-ci.org/release-it/release-it.svg?branch=master)](https://travis-ci.org/release-it/release-it)
[![Action Status](https://github.com/release-it/release-it/workflows/Cross-OS%20Tests/badge.svg)](https://github.com/release-it/release-it/actions)
[![npm version](https://badge.fury.io/js/release-it.svg)](https://badge.fury.io/js/release-it)
[![codecov](https://codecov.io/gh/release-it/release-it/branch/master/graph/badge.svg)](https://codecov.io/gh/release-it/release-it)

Expand Down Expand Up @@ -48,7 +48,6 @@
- [Publish to npm](#publish-to-npm)
- [Manage pre-releases](#manage-pre-releases)
- [Hooks](#hooks)
- [Scripts (deprecated)](#scripts-deprecated)
- [Plugins](#plugins)
- [Distribution repository](#distribution-repository)
- [Metrics](#metrics)
Expand Down Expand Up @@ -136,7 +135,7 @@ $ git rev-parse --git-dir

## Configuration

Out of the box, release-it has sane defaults, and [plenty of options](./conf/release-it.json) to configure it. Put
Out of the box, release-it has sane defaults, and [plenty of options](./config/release-it.json) to configure it. Put
(only) the options to override in a configuration file. This is where release-it looks for configuration:

- `.release-it.json`
Expand Down Expand Up @@ -210,8 +209,6 @@ By using the `--ci` option, the process is fully automated without prompts. The
demonstrated in the first animation above. On a Continuous Integration (CI) environment, this non-interactive mode is
activated automatically.

Note: the old `-n` (or `--non-interactive`) option still works and is identical to `--ci`.

## Latest version

For projects with a `package.json`, its `version` will be used. Otherwise, release-it uses the latest Git tag to
Expand Down Expand Up @@ -278,7 +275,7 @@ export GITLAB_TOKEN="f941e0..."
By default, release-it generates a changelog, to show and help select a version for the new release. Additionally, this
changelog serves as the release notes for the GitHub or GitLab release.

The [default command](./conf/release-it.json) is based on `git log ...`. This setting (`git.changelog`) can be
The [default command](./config/release-it.json) is based on `git log ...`. This setting (`git.changelog`) can be
overridden. To customize the release notes for the GitHub or GitLab release, use `github.releaseNotes` or
`gitlab.releaseNotes`. Make sure any of these commands output the changelog to `stdout`.

Expand Down Expand Up @@ -339,8 +336,8 @@ will run one after another. Some example release-it configuration:
}
```

The variables can be found in the [default configuration](./conf/release-it.json). Additionally, the following variables
are exposed:
The variables can be found in the [default configuration](./config/release-it.json). Additionally, the following
variables are exposed:

```
version
Expand All @@ -359,17 +356,6 @@ For the sake of verbosity and to not complicate matters further, the above table
is actually: `init`, `beforeBump`, `bump`, `beforeRelease`, `release` or `afterRelease`. However, hooks like
`before:beforeRelease` look weird and are usually not useful in practice.

## Scripts (deprecated)

Please use [hooks](#hooks) instead, as hooks are more flexible. The `scripts` will stay for a while, but will be removed
in a few major releases after v12. Here's how to migrate:

- `scripts.beforeStart``hooks.before:init`
- `scripts.beforeBump``hooks.before:bump`
- `scripts.afterBump``hooks.after:bump`
- `scripts.beforeStage``hooks.after:bump`
- `scripts.afterRelease``hooks.after:release`

## Plugins

Since v11, release-it can be extended in many, many ways.
Expand Down Expand Up @@ -427,16 +413,3 @@ While mostly used as a CLI tool, release-it can be used as a dependency to ingra
- [Prereleases and npm](https://medium.com/@mbostock/prereleases-and-npm-e778fc5e2420)
- [Glob Primer (node-glob)](https://github.com/isaacs/node-glob#glob-primer) (release-it uses
[globby](https://github.com/sindresorhus/globby#readme))

## Credits

Major dependencies:

- [ShellJS](https://documentup.com/shelljs/shelljs)
- [Inquirer.js](https://github.com/SBoudrias/Inquirer.js)
- [@octokit/rest](https://github.com/octokit/rest.js)

The following Grunt plugins have been a source of inspiration:

- [grunt-release](https://github.com/geddski/grunt-release)
- [grunt-release-component](https://github.com/walmartlabs/grunt-release-component)
8 changes: 5 additions & 3 deletions bin/release-it.js
Expand Up @@ -10,14 +10,13 @@ const aliases = {
d: 'dry-run',
h: 'help',
i: 'increment',
n: 'non-interactive',
v: 'version',
V: 'verbose'
};

const parseCliArguments = args => {
const options = parseArgs(args, {
boolean: ['dry-run', 'ci', 'non-interactive'],
boolean: ['dry-run', 'ci'],
alias: aliases,
default: {
'dry-run': false,
Expand All @@ -35,4 +34,7 @@ const parseCliArguments = args => {
const options = parseCliArguments([].slice.call(process.argv, 2));

updater({ pkg: pkg }).notify();
release(options).then(() => process.exit(0), () => process.exit(1));
release(options).then(
() => process.exit(0),
() => process.exit(1)
);
1 change: 1 addition & 0 deletions conf
11 changes: 0 additions & 11 deletions conf/deprecated.json

This file was deleted.

1 change: 1 addition & 0 deletions config/deprecated.json
@@ -0,0 +1 @@
{}
9 changes: 5 additions & 4 deletions conf/release-it.json → config/release-it.json
Expand Up @@ -9,18 +9,19 @@
"addUntrackedFiles": false,
"commit": true,
"commitMessage": "Release ${version}",
"commitArgs": "",
"commitArgs": [],
"tag": true,
"tagName": "${version}",
"tagAnnotation": "Release ${version}",
"tagArgs": "",
"tagArgs": [],
"push": true,
"pushArgs": "--follow-tags",
"pushRepo": "origin"
"pushArgs": ["--follow-tags"],
"pushRepo": ""
},
"npm": {
"publish": true,
"publishPath": ".",
"tag": null,
"access": null,
"otp": null,
"ignoreVersion": false
Expand Down
9 changes: 4 additions & 5 deletions docs/changelog.md
Expand Up @@ -3,7 +3,7 @@
By default, release-it generates a changelog, to show and help select a version for the new release. Additionally, this
changelog serves as the release notes for the GitHub or GitLab release.

The [default command](../conf/release-it.json) is based on `git log ...`. This setting (`git.changelog`) can be
The [default command](../config/release-it.json) is based on `git log ...`. This setting (`git.changelog`) can be
overridden. To customize the release notes for the GitHub or GitLab release, use `github.releaseNotes` or
`gitlab.releaseNotes`. Make sure any of these commands output the changelog to `stdout`.

Expand All @@ -21,17 +21,16 @@ A tool like [auto-changelog](https://github.com/CookPete/auto-changelog) is a gr
```json
{
"git": {
"changelog": "npx auto-changelog --stdout --commit-limit false -u --template https://raw.githubusercontent.com/release-it/release-it/master/conf/changelog-compact.hbs"
"changelog": "npx auto-changelog --stdout --commit-limit false -u --template https://raw.githubusercontent.com/release-it/release-it/master/config/changelog-compact.hbs"
},
"hooks": {
"after:bump": "npx auto-changelog -p"
}
}
```

With this `git.changelog`, the changelog preview is based on the `changelog-compact.hbs`
template file. This would be used for [GitHub](./github-releases.md)
or [GitLab releases](./gitlab-releases.md) as well.
With this `git.changelog`, the changelog preview is based on the `changelog-compact.hbs` template file. This would be
used for [GitHub](./github-releases.md) or [GitLab releases](./gitlab-releases.md) as well.

Additionally, `hooks.after:bump` will update the `CHANGELOG.md` with each release to get included with the release
commit. This can be omitted if the project does not keep a `CHANGELOG.md` or similar.
Expand Down
9 changes: 5 additions & 4 deletions docs/git.md
Expand Up @@ -12,7 +12,7 @@ The Git plugin in release-it, by default, does the following:
When not in CI mode, release-it will ask for confirmation before each of the commit, tag, and push steps.

Configure the `[git.*]` options to modify the commands accordingly. See
[all options and their default values](../conf/release-it.json).
[all options and their default values](../config/release-it.json).

## SSH keys & Git remotes

Expand All @@ -28,8 +28,9 @@ The following help pages might be useful:

## Remote repository

By default, `release-it` uses `"origin"` as the remote name to push to. Use `git.pushRepo` to override this with a
different remote name, or a different git url.
By default, `release-it` uses branch's tracking information, unless there isn't any, in which case it defaults to
`"origin"` as the remote name to push to. Use `git.pushRepo` to override this with a different remote name, or a
different git url.

## Extra arguments

Expand All @@ -39,7 +40,7 @@ In case extra arguments should be provided to Git, these options are available:
- `git.tagArgs`
- `git.pushArgs`

For example, use `"git.commitArgs": "-S"` to sign commits (also see
For example, use `"git.commitArgs": ["-S"]` to sign commits (also see
[#35](https://github.com/release-it/release-it/issues/350)).

## Skip Git steps
Expand Down
12 changes: 4 additions & 8 deletions docs/gitlab-releases.md
@@ -1,8 +1,9 @@
# GitLab Releases

GitLab 11.7 introduces [Releases](https://docs.gitlab.com/ce/user/project/releases.html) to create release entries (much
like GitHub), including release assets. Releases are attached to an existing Git tag, so make sure the
[Git part](./git.md) is configured correctly.
For this feature, at least GitLab v11.7 is required. GitLab 11.7 introduces
[Releases](https://docs.gitlab.com/ce/user/project/releases.html) to create release entries (much like GitHub),
including release assets. Releases are attached to an existing Git tag, so make sure the [Git part](./git.md) is
configured correctly.

[GitLab releases](https://docs.gitlab.com/ce/user/project/releases/) work just like GitHub releases:

Expand Down Expand Up @@ -35,11 +36,6 @@ An example:

See [Changelog](./changelog.md) for more information about generating changelogs/release notes.

## GitLab 11.6 (and lower)

For GitLab 11.6 and lower, a [GitLab Release](https://docs.gitlab.com/ce/user/project/releases/) means release-it will
automatically fall back to [attach releases notes to a tag](https://docs.gitlab.com/ce/user/project/releases/#add-release-notes-to-git-tags). In this case, assets will not get included.

## Attach binary assets

To upload binary release assets with a GitLab release (such as compiled executables, minified scripts, documentation),
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins.md
Expand Up @@ -289,7 +289,7 @@ Execute commands in the child process (i.e. the shell). This is used extensively

Use template variables to render replacements. For instance, the command `git log ${latestTag}...HEAD` becomes
`git log v1.2.3...HEAD` before being executed. The replacements are all configuration options (with the default values
in [conf/release-it.json](../conf/release-it.json)), plus the following variables:
in [config/release-it.json](../config/release-it.json)), plus the following variables:

```
version
Expand Down
4 changes: 2 additions & 2 deletions docs/prerequisites.md
Expand Up @@ -40,8 +40,8 @@ be committed with the release commit, use `--no-git.requireCleanWorkingDir` or c
If no upstream branch is known to Git, it does not know where to push the release commit and tag to, and halts.

Use `--no-git.requireUpstream` to add `--set-upstream [remote] [branch]` to the `git push` command, where `[remote]` is
the value of `git.pushRepo` ("origin" by default), and `[branch]` is the name of the current branch. So if the current
branch is `next` then the full command becomes `git push --follow-tags --set-upstream origin next`.
the value of `git.pushRepo` ("origin" by default, if no upstream branch), and `[branch]` is the name of the current
branch. So if the current branch is `next` then the full command becomes `git push --follow-tags --set-upstream origin next`.

Configure `pushRepo` with either a remote name or a Git url to push the release to that remote instead of "origin".

Expand Down

0 comments on commit ba97a5c

Please sign in to comment.