Compare commits

...
18 Commits
Author SHA1 Message Date
Kaito UdagawaandGregor Martynus 0c79a9b4bf fix(post): create git tag properly
refs/heads are for branches and refs/tags for tags.
2017-08-16 20:47:29 -07:00
Kaito UdagawaandGregor Martynus 3f8559731f fix(post): Create a tag before makeing a release 2017-08-13 20:29:49 -07:00
Kaito UdagawaandGregor Martynus f148a61339 fix(post): fix target_commitish to be the default branch
target_commitish in GitHub Releases has two different meanings:
* Target commit that a new associated tag will be created on
* Target branch to compute how many "commits to since this release"

target_commitish is usually the default branch (aka master), because the
distance between the release and the latest branch is the primary concern.

Before this change, target_commitish was left to be a hash and the
feature of GitHub Releases that shows how much time passed since the
release is ruined, because no tracking branch is given.

By this change, target_commitish is changed to be the default branch
given in the configuration (options.branch) via edit a release API after
the release and tag are created via crate a release API.
2017-08-13 20:29:49 -07:00
Gregor 5b3bdd226f chore: remove console.log 2017-08-13 12:10:36 -07:00
Gregor 64d84a0e84 chore(travis): drop builds in Node <4 2017-08-13 12:10:36 -07:00
greenkeeper[bot]andGregor Martynus 1fa6d50264 fix(package): update @semantic-release/release-notes-generator to version 3.0.1
BREAKING CHANGE: Dropped support for unmaintained Node.js versions (< v4)
2017-08-13 12:10:36 -07:00
Jan Peer StöcklmairandGregor Martynus 6145bc9ba5 docs(readme): add sgc (#386) 2017-08-12 15:59:01 -07:00
Piper ChesterandGregor Martynus 609b46f1cf docs(README): minor typo (#376) 2017-06-12 13:41:42 +02:00
greenkeeper[bot]andStephan Bönnemann 76cd99c3a5 chore(package): update standard to version 9.0.0
https://greenkeeper.io/
2017-03-06 10:13:19 +01:00
greenkeeper[bot]andStephan Bönnemann 22dc640117 chore(package): update tap to version 10.0.1
https://greenkeeper.io/
2017-02-03 11:37:47 +01:00
Stephan BönnemannandGitHub af90de989e Merge pull request #355 from semantic-release/dep-updates
Misc GK dep updates
2017-01-13 12:13:30 +01:00
Stephan Bönnemann aa012b3023 Merge branch 'greenkeeper/tap-9.0.0' into dep-updates
* greenkeeper/tap-9.0.0:
  chore(package): update tap to version 9.0.0
2017-01-13 12:04:45 +01:00
Stephan Bönnemann 5724b19e23 Merge branch 'greenkeeper/github-8.0.0' into dep-updates
* greenkeeper/github-8.0.0:
  fix(package): update github to version 8.0.0
2017-01-13 12:04:25 +01:00
Stephan BönnemannandGitHub 97a8e73b01 Merge branch 'caribou' into greenkeeper/nopt-4.0.0 2017-01-13 11:51:22 +01:00
Cory ReedandStephan Bönnemann 51e12a3a4b docs(package): fix 'home' link 2017-01-13 11:51:04 +01:00
greenkeeper[bot] afd6ab754d fix(package): update github to version 8.0.0
https://greenkeeper.io/
2017-01-11 17:54:30 +00:00
greenkeeper[bot] f80e056e13 chore(package): update tap to version 9.0.0
https://greenkeeper.io/
2017-01-08 07:14:51 +00:00
greenkeeper[bot] b10c8910fb fix(package): update nopt to version 4.0.0
https://greenkeeper.io/
2016-12-13 23:38:46 +00:00
7 changed files with 46 additions and 25 deletions
+7 -8
View File
@@ -2,17 +2,13 @@ sudo: false
language: node_js
cache:
directories:
- node_modules
- $HOME/.npm
notifications:
email: false
node_js:
- 5
- 4
- iojs
- '0.12'
- '0.10'
before_install:
- npm i -g npm@^2.0.0
- 8 # stable
- 6 # LTS
- 4 # maintenance
before_script:
- npm prune
after_success:
@@ -20,3 +16,6 @@ after_success:
- npm run semantic-release
services:
- couchdb
branches:
except:
- /^v\d+\.\d+\.\d+$/
+2 -2
View File
@@ -79,7 +79,7 @@ This removes the immediate connection between human emotions and version numbers
Instead of writing [meaningless commit messages](http://whatthecommit.com/), we can take our time to think about the changes in the codebase and write them down. Following formalized conventions it is then possible to generate a helpful changelog and to derive the next semantic version number from them.
When `semantic-release` is setup it will do that after every successful continuous integration build of your master branch (or any other branch you specify) and publish the new version for you. This way no human is directly involved in the release process and your releases are guaranteed to be [unromantic and unsentimental](http://sentimentalversioning.org/).
When `semantic-release` is set up it will do that after every successful continuous integration build of your master branch (or any other branch you specify) and publish the new version for you. This way no human is directly involved in the release process and your releases are guaranteed to be [unromantic and unsentimental](http://sentimentalversioning.org/).
If you fear the loss of control over timing and marketing implications of software releases you should know that `semantic-release` supports [release channels](https://github.com/npm/npm/issues/2718) using `npm`s [dist-tags](https://docs.npmjs.com/cli/dist-tag). This way you can keep control over what your users end up using by default, you can decide when to promote an automatically released version to the stable channel, and you can choose which versions to write blogposts and tweets about. You can use the same mechanism to [support older versions of your software](https://gist.github.com/boennemann/54042374e49c7ade8910), for example with important security fixes.
@@ -106,7 +106,7 @@ format that includes a **type**, a **scope** and a **subject** ([full explanatio
<footer>
```
You can simplify using this convention for yourself and contributors by using [commitizen](https://github.com/commitizen/cz-cli) and [validate-commit-msg](https://github.com/kentcdodds/validate-commit-msg).
You can simplify using this convention for yourself and contributors by using [commitizen](https://github.com/commitizen/cz-cli) and [validate-commit-msg](https://github.com/kentcdodds/validate-commit-msg) or [semantic-git-commit-cli](https://github.com/JPeer264/node-semantic-git-commit-cli).
### Patch Release
+6 -6
View File
@@ -17,12 +17,12 @@
"@semantic-release/condition-travis": "^5.0.2",
"@semantic-release/error": "^1.0.0",
"@semantic-release/last-release-npm": "^1.2.1",
"@semantic-release/release-notes-generator": "^2.0.0",
"@semantic-release/release-notes-generator": "^3.0.1",
"git-head": "^1.2.1",
"github": "^7.0.0",
"github": "^8.0.0",
"lodash": "^4.0.0",
"nerf-dart": "^1.0.0",
"nopt": "^3.0.3",
"nopt": "^4.0.0",
"normalize-package-data": "^2.3.4",
"npmconf": "^2.1.2",
"npmlog": "^4.0.0",
@@ -43,8 +43,8 @@
"nyc": "^10.0.0",
"proxyquire": "^1.7.3",
"rimraf": "^2.5.0",
"standard": "^8.6.0",
"tap": "^8.0.1"
"standard": "^9.0.0",
"tap": "^10.0.1"
},
"engines": {
"node": ">=0.10",
@@ -54,7 +54,7 @@
"bin",
"src"
],
"homepage": "https://github.com/semantic-release/semantic-release/tree/next#readme",
"homepage": "https://github.com/semantic-release/semantic-release#readme",
"keywords": [
"author",
"automation",
+22 -4
View File
@@ -24,12 +24,18 @@ module.exports = function (config, cb) {
if (err) return cb(err)
var ghRepo = parseSlug(pkg.repository.url)
var tag = {
owner: ghRepo[0],
repo: ghRepo[1],
ref: 'refs/tags/v' + pkg.version,
sha: hash
}
var release = {
owner: ghRepo[0],
repo: ghRepo[1],
name: 'v' + pkg.version,
tag_name: 'v' + pkg.version,
target_commitish: hash,
name: 'v' + pkg.version,
target_commitish: options.branch,
draft: !!options.debug,
body: log
}
@@ -43,10 +49,22 @@ module.exports = function (config, cb) {
token: options.githubToken
})
github.repos.createRelease(release, function (err) {
if (options.debug) {
return github.repos.createRelease(release, function (err) {
if (err) return cb(err)
cb(null, true, release)
})
}
github.gitdata.createReference(tag, function (err) {
if (err) return cb(err)
cb(null, true, release)
github.repos.createRelease(release, function (err) {
if (err) return cb(err)
cb(null, true, release)
})
})
})
})
+5
View File
@@ -3,6 +3,11 @@ module.exports = function () {
authenticate: function () {
return true
},
gitdata: {
createReference: function (release, cb) {
cb(null)
}
},
repos: {
createRelease: function (release, cb) {
cb(null)
+4 -4
View File
@@ -23,14 +23,14 @@ var defaultRelease = {
repo: 'up',
name: 'v1.0.0',
tag_name: 'v1.0.0',
target_commitish: 'bar',
target_commitish: 'master',
body: 'the log'
}
test('full post run', function (t) {
t.test('in debug mode w/o token', function (tt) {
post({
options: {debug: true},
options: {debug: true, branch: 'master'},
pkg: pkg,
plugins: plugins
}, function (err, published, release) {
@@ -44,7 +44,7 @@ test('full post run', function (t) {
t.test('in debug mode w/token', function (tt) {
post({
options: {debug: true, githubToken: 'yo'},
options: {debug: true, githubToken: 'yo', branch: 'master'},
pkg: pkg,
plugins: plugins
}, function (err, published, release) {
@@ -58,7 +58,7 @@ test('full post run', function (t) {
t.test('production', function (tt) {
post({
options: {githubToken: 'yo'},
options: {githubToken: 'yo', branch: 'master'},
pkg: pkg,
plugins: plugins
}, function (err, published, release) {
-1
View File
@@ -39,7 +39,6 @@ test('verify pkg, options and env', function (t) {
}
})
console.log(noErrors)
tt.is(noErrors.length, 0)
tt.end()
})