Browse Source

Create release note in CI (#6218)

Yogev Ben David 4 years ago
parent
commit
3e9a2f274f
No account linked to committer's email address
3 changed files with 36 additions and 1 deletions
  1. 29
    0
      .grenrc.js
  2. 2
    1
      package.json
  3. 5
    0
      scripts/release.js

+ 29
- 0
.grenrc.js View File

@@ -0,0 +1,29 @@
1
+module.exports = {
2
+  template: {
3
+    commit: ({message, url, author, name}) => `- [${message}](${url}) - ${author ? `@${author}` : name}`,
4
+    issue: "- {{name}} [{{text}}]({{url}})",
5
+    label: "[**{{label}}**]",
6
+    noLabel: "closed",
7
+    group: "\n#### {{heading}}\n",
8
+    changelogTitle: "# Changelog\n\n",
9
+    release: "## {{release}} ({{date}})\n{{body}}",
10
+    releaseSeparator: "\n---\n\n"
11
+  },
12
+  groupBy: {
13
+    "Enhancements:": ["type: accepted/enhancement", "internal"],
14
+    "Bug Fixes:": ["type: accepted/bug"],
15
+    "Features": ["feature"]
16
+  },
17
+  ignoreIssuesWith: [
18
+    "skip-changelog"
19
+  ],
20
+  ignoreTagsWith: [
21
+    "snapshot",
22
+    "v1",
23
+    "v2"
24
+  ],
25
+  dataSource: "prs",
26
+  changelogFilename: "CHANGELOG.gren.md",
27
+  override: true,
28
+  generate: true
29
+}

+ 2
- 1
package.json View File

@@ -91,7 +91,8 @@
91 91
     "tslint": "5.x.x",
92 92
     "typedoc": "0.x.x",
93 93
     "typescript": "3.2.2",
94
-    "identity-obj-proxy": "3.0.0"
94
+    "identity-obj-proxy": "3.0.0",
95
+    "github-release-notes": "0.17.3"
95 96
   },
96 97
   "jest": {
97 98
     "preset": "react-native",

+ 5
- 0
scripts/release.js View File

@@ -126,6 +126,11 @@ function updatePackageJsonGit(version) {
126 126
     exec.execSync(`git add package.json`);
127 127
     exec.execSync(`git commit -m"Update package.json version to ${version} [ci skip]"`);
128 128
     exec.execSync(`git push deploy ${BRANCH}`);
129
+    draftGitRelease(version);
130
+}
131
+
132
+function draftGitRelease(version) {
133
+    exec.execSync(`npx gren release --tags=${version}`);
129 134
 }
130 135
 
131 136
 run();