Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Add a release-notes script that outputs a release notes template #356

Merged
merged 1 commit into from
Nov 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"watch": "gulp watch",
"install-husky": "node node_modules/husky/bin/install",
"commitmsg": "node scripts/validateCommitMessage.js",
"release-notes": "node scripts/printReleaseNotesTemplate.js",
"versions": "node scripts/normalizeDependencyVersions.js",
"normalize-pkgfields": "node scripts/normalizePackageFields.js"
},
Expand All @@ -43,6 +44,7 @@
"eslint-config-sanity": "^3.1.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-react": "^7.4.0",
"execa": "^0.8.0",
"glob": "^7.1.2",
"gulp": "^3.9.1",
"gulp-babel": "^6.1.2",
Expand Down
41 changes: 41 additions & 0 deletions scripts/printReleaseNotesTemplate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const CHANGELOG_COMMAND = 'git log --pretty=format:\'%aN | %s | %h\' --abbrev-commit --reverse origin/master..origin/next'

const execa = require('execa')
const TEMPLATE = `
Upgrade with:
sanity upgrade
And install the latest Command Line Interface (CLI) with:
npm install --global @sanity/cli
# ✨ Highlights
## Awesome feature X
A few words about the awesome feature X, preferably with screengifs
## Awesome feature Y
A few words about the awesome feature Y, preferably with screengifs
## Other features
- This is feature is not that important, but worth mentioning anyway
# 🐛 Notable bugfixes
- Fixed 🐞
- Fixed 🐛
- Fixed 🦗
# 📓 Full changelog
Author | Message | Commit
------------ | ------------- | -------------
${execa.shellSync(CHANGELOG_COMMAND).stdout}
`

console.log(`
-------- SANITY RELEASE NOTES TEMPLATE --------
Use the following template as a starting point for next release:
A draft can be created here: https://github.com/sanity-io/sanity/releases/new
-------- BEGIN TEMPLATE --------
${TEMPLATE}
-------- END TEMPLATE --------`)