Code Monkey home page Code Monkey logo

release-it's Introduction

Release It! ๐Ÿš€

๐Ÿš€ Generic CLI tool to automate versioning and package publishing-related tasks:

Use release-it for version management and publish to anywhere with its versatile configuration, a powerful plugin system, and hooks to execute any command you need to test, build, and/or publish your project.

Action Status npm version

Are you using release-it at work? Please consider sponsoring me!

Installation

Although release-it is a generic release tool, most projects use it for projects with npm packages. The recommended way to install release-it uses npm and adds some minimal configuration to get started:

npm init release-it

Alternatively, install it manually, and add the release script to package.json:

npm install -D release-it
{
  "name": "my-package",
  "version": "1.0.0",
  "scripts": {
    "release": "release-it"
  },
  "devDependencies": {
    "release-it": "^16.1.0"
  }
}

Usage

Run release-it from the root of the project using either npm run or npx:

npm run release
npx release-it

You will be prompted to select the new version, and more prompts will follow based on your configuration.

Yarn

Using Yarn? Please see the npm section on Yarn.

Monorepos

Using a monorepo? Please see this monorepo recipe.

Global Installation

Per-project installation as shown above is recommended, but global installs are supported as well:

  • From npm: npm install -g release-it
  • From Homebrew: brew install release-it

Containerized

Use Release It! - Containerized to run it in any environment as a standardized container without the need for a Node environment. Thanks Juan Carlos!

Videos, articles & examples

Here's a list of interesting external resources:

Want to add yours to the list? Just open a pull request!

Configuration

Out of the box, release-it has sane defaults, and plenty of options to configure it. Most projects use a .release-it.json file in the project root, or a release-it property in package.json.

Here's a quick example .release-it.json:

{
  "git": {
    "commitMessage": "chore: release v${version}"
  },
  "github": {
    "release": true
  }
}

โ†’ See Configuration for more details.

Interactive vs. CI mode

By default, release-it is interactive and allows you to confirm each task before execution:

By using the --ci option, the process is fully automated without prompts. The configured tasks will be executed as demonstrated in the first animation above. In a Continuous Integration (CI) environment, this non-interactive mode is activated automatically.

Use --only-version to use a prompt only to determine the version, and automate the rest.

Latest version

How does release-it determine the latest version?

  1. For projects with a package.json, its version will be used (see npm to skip this).
  2. Otherwise, release-it uses the latest Git tag to determine which version should be released.
  3. As a last resort, 0.0.0 will be used as the latest version.

Alternatively, a plugin can be used to override this (e.g. to manage a VERSION or composer.json file):

Add the --release-version flag to print the next version without releasing anything.

Git

Git projects are supported well by release-it, automating the tasks to stage, commit, tag and push releases to any Git remote.

โ†’ See Git for more details.

GitHub Releases

GitHub projects can have releases attached to Git tags, containing release notes and assets. There are two ways to add GitHub releases in your release-it flow:

  1. Automated (requires a GITHUB_TOKEN)
  2. Manual (using the GitHub web interface with pre-populated fields)

โ†’ See GitHub Releases for more details.

GitLab Releases

GitLab projects can have releases attached to Git tags, containing release notes and assets. To automate GitLab releases:

โ†’ See GitLab Releases for more details.

Changelog

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 is based on git log .... This setting (git.changelog) can be overridden. To further customize the release notes for the GitHub or GitLab release, there's github.releaseNotes or gitlab.releaseNotes. Make sure any of these commands output the changelog to stdout. Note that release-it by default is agnostic to commit message conventions. Plugins are available for:

  • GitHub and GitLab Releases
  • auto-changelog
  • Conventional Changelog
  • Keep A Changelog

To print the changelog without releasing anything, add the --changelog flag.

โ†’ See Changelog for more details.

Publish to npm

With a package.json in the current directory, release-it will let npm bump the version in package.json (and package-lock.json if present), and publish to the npm registry.

โ†’ See Publish to npm for more details.

Manage pre-releases

With release-it, it's easy to create pre-releases: a version of your software that you want to make available, while it's not in the stable semver range yet. Often "alpha", "beta", and "rc" (release candidate) are used as identifiers for pre-releases. An example pre-release version is 2.0.0-beta.0.

โ†’ See Manage pre-releases for more details.

Update or re-run existing releases

Use --no-increment to not increment the last version, but update the last existing tag/version.

This may be helpful in cases where the version was already incremented. Here are a few example scenarios:

  • To update or publish a (draft) GitHub Release for an existing Git tag.
  • Publishing to npm succeeded, but pushing the Git tag to the remote failed. Then use release-it --no-increment --no-npm to skip the npm publish and try pushing the same Git tag again.

Hooks

Use script hooks to run shell commands at any moment during the release process (such as before:init or after:release).

The format is [prefix]:[hook] or [prefix]:[plugin]:[hook]:

part value
prefix before or after
plugin version, git, npm, github, gitlab
hook init, bump, release

Use the optional :plugin part in the middle to hook into a life cycle method exactly before or after any plugin.

The core plugins include version, git, npm, github, gitlab.

Note that hooks like after:git:release will not run when either the git push failed, or when it is configured not to be executed (e.g. git.push: false). See execution order for more details on execution order of plugin lifecycle methods.

All commands can use configuration variables (like template strings). An array of commands can also be provided, they will run one after another. Some example release-it configuration:

{
  "hooks": {
    "before:init": ["npm run lint", "npm test"],
    "after:my-plugin:bump": "./bin/my-script.sh",
    "after:bump": "npm run build",
    "after:git:release": "echo After git push, before github release",
    "after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
  }
}

The variables can be found in the default configuration. Additionally, the following variables are exposed:

version
latestVersion
changelog
name
repo.remote, repo.protocol, repo.host, repo.owner, repo.repository, repo.project
branchName
releaseUrl

All variables are available in all hooks. The only exception is that the additional variables listed above are not yet available in the init hook.

Use --verbose to log the output of the commands.

For the sake of verbosity, the full list of hooks is actually: init, beforeBump, bump, beforeRelease, release or afterRelease. However, hooks like before:beforeRelease look weird and are usually not useful in practice.

Note that arguments need to be quoted properly when used from the command line:

release-it --'hooks.after:release="echo Successfully released ${name} v${version} to ${repo.repository}."'

Using Inquirer.js inside custom hook scripts might cause issues (since release-it also uses this itself).

Dry Runs

Use --dry-run to show the interactivity and the commands it would execute.

โ†’ See Dry Runs for more details.

Troubleshooting & debugging

  • With release-it --verbose (or -V), release-it prints the output of every user-defined hook.
  • With release-it -VV, release-it also prints the output of every internal command.
  • Use NODE_DEBUG=release-it:* release-it [...] to print configuration and more error details.

Use verbose: 2 in a configuration file to have the equivalent of -VV on the command line.

Plugins

Since v11, release-it can be extended in many, many ways. Here are some plugins:

Plugin Description
@release-it/bumper Read & write the version from/to any file
@release-it/conventional-changelog Provides recommended bump, conventional-changelog, and updates CHANGELOG.md
@release-it/keep-a-changelog Maintain CHANGELOG.md using the Keep a Changelog standards
@release-it-plugins/lerna-changelog Integrates lerna-changelog into the release-it pipeline
@jcamp-code/release-it-changelogen Use @unjs/changelogen for versioning and changelog
@release-it-plugins/workspaces Releases each of your projects configured workspaces
release-it-calver-plugin Enables Calendar Versioning (calver) with release-it
@grupoboticario/news-fragments An easy way to generate your changelog file
@j-ulrich/release-it-regex-bumper Regular expression based version read/write plugin for release-it
@jcamp-code/release-it-dotnet Use .csproj or .props file for versioning, automate NuGet publishing
release-it-pnpm Add basic support for pnpm workspaces, integrates with bumpp and changelogithub

Internally, release-it uses its own plugin architecture (for Git, GitHub, GitLab, npm).

โ†’ See all release-it plugins on npm.

โ†’ See plugins for documentation to write plugins.

Use release-it programmatically

While mostly used as a CLI tool, release-it can be used as a dependency to integrate in your own scripts. See use release-it programmatically for example code.

Example projects using release-it

Legacy Node.js

The latest major version is v17, supporting Node.js 18 and up (as Node.js v16 is EOL). The previous major version was v16, supporting Node.js 16. Use release-it v15 for environments running Node.js v14. Also see CHANGELOG.md.

Links

License

MIT

Are you using release-it at work? Please consider sponsoring me!

release-it's People

Contributors

achichen avatar b12k avatar bmish avatar cakeinpanic avatar chocolateloverraj avatar dependabot[bot] avatar dszakallas avatar greenkeeper[bot] avatar iamthehttp avatar imgrant avatar michaelmure avatar naveensrinivasan avatar ngotchac avatar owcd avatar papb avatar patrik-piskay avatar philipperoy avatar pi0trpietruszewski avatar prakashregmi avatar pstrh avatar raykle avatar rchl avatar real34 avatar rlsf avatar rodeyseijkens avatar ruzickap avatar rwjblue avatar scalvert avatar webpro avatar xllily avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

release-it's Issues

Do all non-git tasks first

Hey,

Sometimes I run into an issue that cloning fails because rm didn't remove all files. By that time the source repo is already tagged and commited, and I have to manually delete the tag, the commit and force push to reset it to the original state.

I know I could run the script again with --force, but maybe it would be better if all the task that could fail ran first.

For example in order:

  1. bump source repo
  2. build source repo
  3. clone dist repo to .stage
  4. copy dist to .stage
  5. bump dist repo
  6. commit source, dist repo
  7. tag source, dist repo
  8. push source, dist repo
  9. (publish)

Optional check for clean working directory?

We've been using your tool as a replacement for npm version for some time now, enjoying the additional features such as dry runs and interactivity.

One thing we're missing though is the check to make sure the git working directory is clean before releasing.

Do you think such an opt-in-able check is within the scope of release-it?

Thank you!

config from .release.json is being overriden by command line arguments that were not specified

Because command line arguments have highest priority, and optimist.boolean initializes all args to false. So all booleans in .release.json that also can be specified on the command line have no effect.

> release-it.cmd minor --dry-run
{ _: [ 'minor' ],
  d: true,
  'dry-run': true,
  e: false,
  debug: false,
  f: false,
  force: false,
  h: false,
  help: false,
  n: false,
  'non-interactive': false,
  p: false,
  publish: false,
  v: false,
  version: false,
  V: false,
  verbose: false,
  '$0': 'node C:\\Users\\necros\\AppData\\Roaming\\npm\\node_modules\\release-it\\bin\\release.js',
  i: 'minor',
  increment: 'minor',
  commitMessage: undefined }

Error: 504: Gateway Timeout from github

Hi,

I was trying to create github release using release-it but after running release-it without any errors, github release was missing. I tried to find what is going on and I manage to log error response from githubClient.releases.createRelease. I was getting 504 response all the time but without any warnings from release-it. I double check my token and I mange to send a request using Postman REST client. I don't know if this is related but there is new version of github module 1.1.0 and old one is deprecated. I spend some time trying to log what was send to github but I didn't find anything unusually.

{ [Error: 504: Gateway Timeout] defaultMessage: 'Gateway Timeout', message: '504: Gateway Timeout', code: '504' }

Dist Directory When Not Building Artifacts

I had a question, and potential workflow issue, when using the latest release of release-it programmatically (as compared to v0.0.15).

I tend to setup an npm run-script called build that will lint my node module using jscs and jshint. I also setup a an npm run-script called test to run my Jasmine/Mocha tests. Lastly, I set the buildCommand option to be npm run build && npm run test.

The idea is that linting and unit testing will be executed before the project is tagged and published.

However, it seems the recent version of release-it will, when buildCommand is set, create a dist/ directory. That causes my working directory to include a dist/ directory.

Now, in my case, because the dist/ directory is empty, git will not attempt to add the directory to my index. Furthermore, git will not show the directory when running git status.

Release-it fails with "WARNING There was a problem bumping the version in package.json"

Hello dears,

I'm trying to use the 'release-it', with no luck.

When I run release-it -e -V, it shows the following :

_: []
d: false
dry-run: false
e: true
debug: true
f: false
force: false
h: false
help: false
n: false
non-interactive: false
p: false
publish: false
v: false
version: 0.2.16
V: true
verbose: true
$0: release-it
name: SaphirJS.utils
pkgFiles: [ 'package.json' ]
increment: patch
commitMessage: Release %s
tagName: %s
tagAnnotation: Release %s
buildCommand: false
distRepo: false
distStageDir: .stage
distBase: dist
distFiles: [ '**/*' ]
Release source repo
[execute] git rev-parse --git-dir
.git
[execute] bump package.json 0.2.16
WARNING There was a problem bumping the version in package.json
[execute] git add package.json
[execute] git diff-index --name-only HEAD --exit-code
ERROR No changes to release. Use --force to override.
[Error: No changes to release. Use --force to override.]

When I run type bump, it says bash: type: bump: not found.

When I have installed bump using npm install -g bump and run again release-is -e -V with no luck (the same output). When I have run bump package.json 0.2.16, it behaves strangely as it sets the version of my package.json to package.json

 SaphirJS.utils:
 v0.2.15 => vpackage.json
 โ†‘ bum bum bumped!

Please help.

Auto convert CRLF to LF

From time to time, I found myself working on a windows machine. Then I'm like good, feels ready for a release. But then, bam, bug reports enters, CRLF is breaking bin files on Unix systems.

Anyway, I feel it'd be nice if there'd be a safe guard where the release helper automagically convert everything (or only bin files?) to simple LF and prevent eventual problems :)

when including; "private: true' in execute, release hangs upon finishing

Here is my release.execute call:

                release.execute({
                    buildCommand:   'npm install && npm run build && npm run ',
                    commitMessage:  'chore(release): v%s',
                    increment:      version,
                    pkgFiles:       'package.json',
                    private:        true,
                    tagAnnotation:  'Release v%s',
                    tagName:        'v%s',
                    verbose:        true
                }).finally(done);
            });

After running release, I am able to publish to git, and as expected I am not prompted to publish to npm. The problem is however, that the task hangs after 'Finished' and I must hit enter to end the procress. This doesnt happen when 'private' is not passed as an argument to execute.

[execute] git tag  --annotate --message="Release v4.0.8" v4.0.8
[?] Push? No
No Git endpoint provided for `distRepo` (distribution repository).
[16:35:27] Finished 'release' after 28 s

Allow pre-releases to be created without modifying the base version

When I push a project with version 1.2.3, I have configured my CI to automatically pre-release it as 1.2.4-commithash.0, this is because I use release-it prepatch. I would prefer to create the release, without modifying the patch version, resulting in 1.2.3-commithash.0.

Unable to bump pkgFiles if they are different files for source and dist repo

Hi,
I only have package.json in the source repo, and only bower.json in the dist repo. I would like to update both, but with

    "pkgFiles": ["package.json", "bower.json"],

i get

WARNING There was a problem bumping the version in bower.json
ERROR fatal: pathspec 'bower.json' did not match any files

Either it needs to not throw an error if the file is not found, or i would need something like "distPkgFiles". It could also be regex or glob patter. What do u think?

Thx

npm-shrinkwrap.json is not being updated to match package.json

I like release-it a bit better than the default npm version command since release-it has better support for named prerelease tags like beta, RC, etc. I like to run npm shrinkwrap to freeze my dependency versions and I check in my npm-shrinkwrap.json into GIT.

However, I notice that release-it doesn't update the npm-shrinkwrap.json file like npm version does by default. This makes the package.json and the npm-shrinkwrap.json file out of sync showing different version numbers.

Could you make an update of the npm-shrinkwrap.json version number to match the package.json version number during a release when npm-shrinkwrap.json exists?

Replace optimist

Optimist is obsolete and doesn't support default values for booleans. yargs, for example, does. Required to fully fix #22.

require('yargs')
    .boolean('bla')
    .alias('b', 'bla')
    .default('bla', undefined)
    .argv

Changelog verification

What would it take to add a step to check that either README or CHANGELOG had something that looked like the latest release version in it, or dropped to $EDITOR to create a changelog message when cutting a release?

Error on first run when allowed reporting of usage statistics

Hi, I just installed this module and I got this error on first run (after accepting the tracking prompt). Running npm v2.11.3 and node v0.12.7 on Win7 x64.

C:\Projects\test (master)
ฮป release-it
? May release-it anonymously report usage statistics to improve the tool over time? Yes
C:\Users\user\AppData\Roaming\npm\node_modules\release-it\node_modules\insight\node_modules\inquirer\node_modules\rx\dist\rx.js:579
    throw e;
          ^
TypeError: undefined is not a function
    at C:\Users\user\AppData\Roaming\npm\node_modules\release-it\lib\tracker.js:36:22
    at Insight.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\release-it\node_modules\insight\lib\index.js:116:3)
    at PromptUI.onCompletion (C:\Users\user\AppData\Roaming\npm\node_modules\release-it\node_modules\insight\node_modules\inquirer\lib\ui\prompt.js:69:10)
    at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.completed (C:\Users\user\AppData\Roaming\npm\node_modules\release-it\node_modules\insight\node_modules\inquirer\node_modules\rx\dist\rx.js:1793:12)
    at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onCompleted (C:\Users\user\AppData\Roaming\npm\node_modules\release-it\node_modules\insight\node_modules\inquirer\node_modules\rx\dist\rx.js:1730:14)
    at AnonymousObserver.tryCatcher (C:\Users\user\AppData\Roaming\npm\node_modules\release-it\node_modules\insight\node_modules\inquirer\node_modules\rx\dist\rx.js:567:29)
    at AutoDetachObserverPrototype.completed (C:\Users\user\AppData\Roaming\npm\node_modules\release-it\node_modules\insight\node_modules\inquirer\node_modules\rx\dist\rx.js:5288:56)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onCompleted (C:\Users\user\AppData\Roaming\npm\node_modules\release-it\node_modules\insight\node_modules\inquirer\node_modules\rx\dist\rx.js:1730:14)
    at InnerObserver.onCompleted (C:\Users\user\AppData\Roaming\npm\node_modules\release-it\node_modules\insight\node_modules\inquirer\node_modules\rx\dist\rx.js:3425:65)
    at InnerObserver.tryCatcher (C:\Users\user\AppData\Roaming\npm\node_modules\release-it\node_modules\insight\node_modules\inquirer\node_modules\rx\dist\rx.js:567:29)

Consecutive runs are without this issue.

Cannot install release-it anymore

Hi,

I got this really strange error after updating npm and my other global modules :

$ npm install -g release-it
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xxxxxx\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "release-it"
npm ERR! node v4.2.2
npm ERR! npm  v3.7.3

npm ERR! Invalid Version: 0.0.1alpha1
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     C:\xxxxxxxx\xxxxxxx\xxxxxxxx\xxxxxxx\npm-debug.log





$ npm install -g [email protected]
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xxxxxx\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "[email protected]"
npm ERR! node v4.2.2
npm ERR! npm  v3.7.3

npm ERR! Invalid Version: 0.0.1alpha1
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     C:\xxxxxxxx\xxxxxxx\xxxxxxxx\xxxxxxx\npm-debug.log

An idea about the root cause ?
I cannot install the module anymore ... which makes me very sad ! :)

release-it hangs on username request in Windows

In my system (Windows 7) release-it does not finish releasing process because the tool hangs on username requesting. Below is console output:

Release source repo
[?] Show updated files? Yes
 M History.md
M  package.json
warning: LF will be replaced by CRLF in package.json.
The file will have its original line endings in your working directory.

[?] Commit (Release version 0.0.4)? Yes
[?] Tag (0.0.4)? Yes
[?] Push? Yes
Username for 'https://github.com':

.release.json for the project is the following:

{
    "commitMessage": "Release version %s",
    "tagAnnotation": "Version %s",
    "publish": true
}

initial release errors

I have a new project where I'm trying to do an initial release. release-it fails on

    "changelogCommand": "git log --pretty=format:'* %s (%h)' [REV_RANGE]",

which resolves to

git log --pretty=format:'* %s (%h)' 0.0.0...HEAD

As far as I can tell, the range it's building is "package.version to HEAD", but in this case, what I have in package.version doesn't represent a valid tag.

To get this out, I had to add a custom "changelogCommand" for my initial release.

    "changelogCommand": "git log --pretty=format:'* %s (%h)'",

For subsequent releases I will be able to reuse the default "changelogCommand".

I don't mind submitting a PR to fix, but my solution wasn't elegant. IE: how would the script know that a tag cannot be found because it's the initial release? Looking for your thoughts @webpro. If nothing else, the documentation can be updated with this gotcha.

not working in git-bash

Here is the output I get when calling release-it in a git-bash shell on windows:

$ release-it
Release source repo
ERROR Cannot read property 'substring' of undefined

With the command prompt, I get a more expected:

> release-it
Release source repo
? Show updated files? (y/N)

Add "pre" to releaseTypes

Currently release-it doesn't allow bumping a pre release number.

For example:

Starting version 0.1.0

release-it premajor --dry-run --non-interactive --prereleaseId=rc
[dry-run] bump package.json 1.0.0-rc.0

We've increased the major as expected to 1.0.0 and added the prereleaseId rc.0

If we need to launch another release candidate, currently there is no way for release-it to increase rc.0 to rc.1.

Running pre(major/minor/patch) will update the respective semver version, not the prereleaseId counter.

release-it prepatch --dry-run --non-interactive --prereleaseId=rc
[dry-run] bump package.json 1.0.1-rc.0

This could be solved by adding pre to the list of releaseTypes supported by release-it.

release-it pre --dry-run --non-interactive --prereleaseId=rc
[dry-run] bump package.json 1.0.0-rc.1

@webpro Are there any concerns about including pre as legal releaseTypes?

Failed to install 0.0.8 version: shasum check failed

$ npm install -g release-it

throws an error:

npm ERR! Error: shasum check failed for /var/folders/ck/nl4qvkv12r3d8gvbkdrn4ngr0000gn/T/npm-53481-W5ngt2fy/registry.npmjs.org/release-it/-/release-it-0.0.8.tgz
npm ERR! Expected: 40339708b08460e888e8635fe4ee99586a5d207d
npm ERR! Actual:   1fcb0a574908a411b21c778a8d25918ae6e825b6

I have tested on node v0.10.26 and v0.11.3.

Release-it only tags source repo

Hi,

seems that change in commit 6179c5d made it so that the dist repo is not tagged. I understand from the commit message that this is for the case that dist repo is the same as source repo (dunno when does that make sense), however that is not our case - the source and dist repo are different and both should be tagged.

Should default to publishing to npm

According to the README:

Without a configured distRepo, the package is published to npm.

In my project, N is the default:

[?] Publish "gamepad-plus" to npm? (y/N)

I could be wrong, but it looks like this default should be set to true.

Copy package files to distRepo

In my source repository, I have:

./bower.json
./package.json
./dist/artifact.js

I would like to publish bower.json and artifact.js to the dist repo so it looks like:

bower.json
artifact.js

However, if I use distBase: 'dist', then it will only copy the files that are inside the dist folder. This means that I have to manually update the distributed bower.json when my dependencies change/update, which makes pushing to the dist repo no longer automated.

Perhaps this could be solved by a "copyPkgFiles: true" (however then package.json would get copied as well), or just by stripping distBase off of each of the distFiles like:

var re = new RegExp('^' + distBase);
distFile = distFile.replace(re, '')

This would cause the dist/ to be stripped off of dist/*/, but leave bower.json alone.

Thoughts?

git push --follow-tags

Have you consider using git v1.8.3 git push --follow-tags instead of git push && git push --tags ?

As the tag is annotated, this will prevent for uploading developer unannotated custom tags

--follow-tags

Push all the refs that would be pushed without this option, and also push
annotated tags in refs/tags that are missing from the remote but are pointing
at commit-ish that are reachable from the refs being pushed. This can also
be specified with configuration variable push.followTags. For more information,
see push.followTags in git-config[1].

Insight only in CLI

Would you consider moving the insight setup into the fromCli function so that insight is not started, and user's aren't asked permission, if release-it is used programmatically by other modules?

NPM publish from a build folder?

I would really like to use this project, but I seem to be getting lost. I actually have 2 issues to report, but thought it best to place them here, as they are somewhat related.

  1. There seems to be a severe lack of documentation. I can't find any information on what each property in the .release.json file does, how it's used, how to fill it out, etc. I had to start reading the source code to figure out how each property is used -- which was time consuming. It would be great if the docs could be a bit more granular.

  2. What I'm really hoping to do is build to a staging folder, like lib/, and then NPM publish from that folder so that lib/ is the "root" folder in the NPM package. It seems like this project could do that, but I've been having a hard time figuring it out (because the lack of docs). At first I thought it would be the dist settings, but that seems to require an external repo. Then I tried src, which then requires settings from dist? It's all rather confusing.

All I'm trying to do is run a "release" command (that builds, versions, and pushes/publishes the project), like so:

  • Clean the lib/ folder.
  • Run a build command to compile the src/ folder to lib/.
  • Run a linter (EXIT if a failure).
  • Run tests (EXIT if a failure).
  • Copy over package.json (required to be in the lib folder to publish), readmes, and *.md files to the lib/ folder.
  • Copy over additional arbitrary files to the lib/ folder. Like ./data/foo/bar.json -> lib/data.json.
  • Increment version.
  • Publish the lib/ folder (as the root) to NPM.
  • Push the changes to git.

I simply want to publish from the lib/ folder so that JS imports can omit the lib/ from the path. For example:

// If published from project root
import Matcher from 'interweave/lib/Matcher';

// When published from lib/
import Matcher from 'interweave/Matcher';

My current release process simply uses NPM/Yarn scripts, but I'm looking for something a bit more robust. https://github.com/milesj/interweave/blob/master/package.json

access tag name in release hooks

First of all , thanks a lot for this package, it's saving my life on daily basis.
that said, I want to know if it's possible to access the tag name in some of the release hooks, afterReleaseCommand for example
Thanks in advance

[Feature] Support for conventional changelog

Conventional changelog is a commit convention from angular. I think it is really nice and also very readable for everyone.

There is a node dependency called commitizen where you use git cz instead of git commit, git cz works same like git commit but you go through a command line tool which supports you with writing a conventional commit.

I think it would be very nice to have support for this :)

Greetz

Could not create changelog from latest tag

I am getting the following error with an unchanged .release.json file. (I have previously used release-it successfully)

WARNING Probably the current version in package.json is not a known tag in the repository.
ERROR Could not create changelog (0.3.2) to HEAD.

The relevant sections in the .release.json file are as follows:

"commitMessage": "Release v%s",
"tagName": "v%s",
"tagAnnotation": "Release v%s",
"changelogCommand": "git log --pretty=format:'* %s (%h)' [REV_RANGE]",

Use case for "dist.repo" ?

I'm failing to understand the use case for dist.repo. The script will push my compiled sources to some repository other than the origin?

I know bower commonly pulls from github. Is that the inspiration?

Could you provide a real-world use case (with examples)? I just want to understand it, so I can see how to properly leverage the functionality in my own project.

`owner` is required for `createRelease` in [email protected]

First would like to thanks for this convenient tool for speeding up my regular process making releases.

I am using the latest version of release-it, and since 2.5.0 upgraded to [email protected]. Releasing to github is broken due the missing owner parameter for createRelease function. Causing error:

[execute] node-github releases#createRelease myProject
WARNING Bad Request (Attempt 1 of 3)
WARNING Empty value for parameter 'owner': undefined
WARNING Bad Request (Attempt 2 of 3)
WARNING Empty value for parameter 'owner': undefined
ERROR Bad Request (Attempt 3 of 3)
ERROR Empty value for parameter 'owner': undefined

Explicit push repository url

In one of the npm modules I maintain I use a read-only https url for my origin, and push my changes to my own fork.

I do this so I go through the same pull-request flow that any other contributor goes through and I don't accidentally push code that hasn't already went through CI testing directly to the main repository.

Rather than having the release tags pushed to my fork, failing when it tries to push to the read-only origin, or making my origin writable and accidentally pushing commits to it.
It would be nice to have a .release.json option that would make release-it push tags directly to the SSH push url for the main repository.

fail on push

Hi,

First thanks for this tool which is very useful to maintain my micro libs.

However I found that it always fail on the git push step for me,
I think it should do an explicit "git push origin master" instead of "git push" because that second command is likely to fail for various reason.

For instance if you have other branches (e.g. gh-pages and out of sync, the push will try to push them all and may fails).

Also one of my other library was using the "git://" syntax which doesn't seem to work with this library (or I'm wrong?).

Thanks,

Support for Maven (SNAPSHOT) versioning

First some background

We are in the process of introducing proper versioning, including releasing, to our Grunt build. Our Grunt build is producing a common "style guide" - used by various in-house developed applications (both Java and .Net). Mostly I work with Java, and use Maven for build and dependency management. From our Java applications, the "style guide" is embedded using WebJars pulled down from our internal Nexus.
Until now, we have had no proper versioning of the Grunt build (just a hard-coded default version). For versioning and deployment to Nexus, we have a Maven build wrapper around the Grunt build, using standard Maven versioning in the build wrapper (pom.xml).

What we would like to do

We want to establish a common versioning and release process that is satisfactory for all stakeholders in the ""style guide" (both Java and .Net developers). Ideally, we would like to have the versioning and release process defined for Grunt, and get rid of the Maven build wrapper. In the process of investigating how to do this properly, I came accross release-it.

The problem

I have been doing some prototyping, and currently it seems to be impossible to use Maven versioning with release-it. In particular, the notion of a SNAPSHOT version (pre release version) seems hard to achieve.

My wish

Some way to configure release-it to work more or less as the maven-release-plugin when it comes down to versioning and Git commits/tags. I particular:

  • Always a SNAPSHOT version in HEAD of branch
  • Two commits per release
    • First commit for the release tag
    • Second commit for setting the next development version

New line in --message option

Hi.

Maybe a weird usage but I tried this :

$ release-it --verbose --message "Release %s
- improve readme
- add codeclimate badge"

and finally I got this into github as a commit message :

[ '', 'Release %s\n- improve readme\n- add codeclimate badge' ] '0.1.2'

Link : msieurtoph/any-packages@156500d

Not really annoying but if it can be enhanced, it would be cool.

Thx anyway for your package, it makes release process very simple. ;)

Release to github

We're using npm command line scripts as a build tool for a private project on a private repo in GitHub where it doesn't make sense to release / publish to npm package registry.

Can the options somehow be configured to create a release on the GitHub repository, and not be published to NPM? I wasn't able to grok this just reading the readme file.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.