From 7a4c89f131d4387a01d21dc5fc527753d19d7cb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6nnemann?= Date: Sat, 22 Aug 2015 21:36:07 +0200 Subject: [PATCH] feat: add fallbackTag functionality and map "next" to "latest" You can now map dist-tags onto "fallbackTags". E.g. if you want a development channel like "next" and no version is currently published as "next" semantic-release will fallback to "latest" to determine the new "next" version. This is now the default for "next" -> "latest", but you can specify your own mappings by adding "fallbackTags" to your `package.json`'s "release" field. BREAKING CHANGE: In cases where you pushed a new commit with a "dist-tag" configuration of "next" and no version was previously published as "next", semanitc-release failed and did not publish a new version. It will now automatically fall back to to "latest". --- package.json | 2 +- src/index.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 335479e9..4d81e805 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@semantic-release/commit-analyzer": "^2.0.0", "@semantic-release/condition-travis": "^4.0.0", "@semantic-release/error": "^1.0.0", - "@semantic-release/last-release-npm": "^1.1.1", + "@semantic-release/last-release-npm": "^1.2.0", "@semantic-release/release-notes-generator": "^2.0.0", "git-head": "^1.2.1", "github": "^0.2.4", diff --git a/src/index.js b/src/index.js index ec29ce7c..0d96825c 100644 --- a/src/index.js +++ b/src/index.js @@ -24,6 +24,9 @@ const options = _.defaults( pkg.release, { branch: 'master', + fallbackTags: { + next: 'latest' + }, debug: !env.CI, githubToken: env.GH_TOKEN || env.GITHUB_TOKEN, githubUrl: env.GH_URL