Skip to content

Commit

Permalink
chore(build): replace grunt(release) with semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Ginsburg committed Dec 1, 2021
1 parent bf7b738 commit 37341b9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 54 deletions.
50 changes: 2 additions & 48 deletions gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,13 @@
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-npm')
grunt.loadNpmTasks('grunt-karma')
grunt.initConfig({
pkgFile: 'package.json',
'npm-contributors': {
options: {
commitMessage: 'chore: update contributors'
}
},
conventionalChangelog: {
release: {
options: {
changelogOpts: {
preset: 'angular'
}
},
src: 'CHANGELOG.md'
}
},
conventionalGithubReleaser: {
release: {
options: {
auth: {
type: 'oauth',
token: process.env.GH_TOKEN
},
changelogOpts: {
preset: 'angular'
}
}
}
},
bump: {
options: {
commitMessage: 'chore: release v%VERSION%',
pushTo: 'upstream',
commitFiles: [
'package.json',
'CHANGELOG.md'
]
}
},
karma: {
coffee: {
configFile: 'examples/coffee/karma.conf.coffee'
Expand All @@ -48,19 +17,4 @@ module.exports = function (grunt) {
}
}
})

require('load-grunt-tasks')(grunt)

grunt.registerTask('default', ['karma'])

grunt.registerTask('release', 'Bump the version and publish to NPM.', function (type) {
grunt.task.run([
'npm-contributors',
'bump:' + (type || 'patch') + ':bump-only',
'conventionalChangelog',
'bump-commit',
'conventionalGithubReleaser',
'npm-publish'
])
})
}
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"main": "lib/index.js",
"scripts": {
"lint": "eslint **/*.js",
"test": "mocha && grunt"
"test": "mocha",
"update-contributors": "grunt contributors",
"examples": "grunt karma",
"semantic-release": "semantic-release"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -43,10 +46,7 @@
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"grunt": "^1.0.3",
"grunt-bump": "^0.8.0",
"grunt-cli": "^1.3.2",
"grunt-conventional-changelog": "^6.1.0",
"grunt-conventional-github-releaser": "^1.0.0",
"grunt-karma": "^3.0.2",
"grunt-npm": "^0.0.2",
"husky": "^4.2.3",
Expand All @@ -56,7 +56,6 @@
"karma-firefox-launcher": "1.x || ^0.1.6",
"karma-mocha": "^2.0.1",
"karma-requirejs": "1.x || ^0.2.2",
"load-grunt-tasks": "^5.1.0",
"mocha": "^7.2.0",
"mocks": "0.0.15",
"requirejs": "^2.1.20",
Expand Down Expand Up @@ -142,4 +141,4 @@
"Marceli.no <[email protected]>",
"Matt Lewis <[email protected]>"
]
}
}
3 changes: 3 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ module.exports = {
],
success: [
'@semantic-release/github'
],
fail: [
'@semantic-release/github'
]
}

0 comments on commit 37341b9

Please sign in to comment.