gruntfile.js 925 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. module.exports = function (grunt) {
  2. grunt.initConfig({
  3. pkgFile: 'package.json',
  4. 'npm-contributors': {
  5. options: {
  6. commitMessage: 'chore: update contributors'
  7. }
  8. },
  9. bump: {
  10. options: {
  11. commitMessage: 'chore: release v%VERSION%',
  12. pushTo: 'upstream',
  13. commitFiles: [
  14. 'package.json',
  15. 'CHANGELOG.md'
  16. ]
  17. }
  18. },
  19. conventionalChangelog: {
  20. options: {
  21. changelogOpts: {
  22. preset: 'angular'
  23. }
  24. },
  25. release: {
  26. src: 'CHANGELOG.md'
  27. }
  28. }
  29. })
  30. require('load-grunt-tasks')(grunt)
  31. grunt.registerTask('default', [])
  32. grunt.registerTask('release', 'Bump the version and publish to NPM.', function (type) {
  33. grunt.task.run([
  34. 'npm-contributors',
  35. 'bump-only:' + (type || 'patch'),
  36. 'conventionalChangelog',
  37. 'bump-commit',
  38. 'npm-publish'
  39. ])
  40. })
  41. }