diff --git a/.github/main.workflow b/.github/main.workflow new file mode 100644 index 0000000000000000000000000000000000000000..24ebfb24e282626024ada778c0a590c5a6e274e6 --- /dev/null +++ b/.github/main.workflow @@ -0,0 +1,12 @@ +workflow "Verify labels" { + on = "pull_request" + resolves = "Enforce PR label" +} + +action "Enforce PR label" { + uses = "yogevbd/enforce-label-action@1.0.0" + secrets = ["GITHUB_TOKEN"] + env = { + VALID_LABELS = "bug,enhancement,feature,skip-changelog" + } +} \ No newline at end of file diff --git a/.grenrc.js b/.grenrc.js new file mode 100644 index 0000000000000000000000000000000000000000..b0bad8ad2a29a738409b788430dc8235927d3b6d --- /dev/null +++ b/.grenrc.js @@ -0,0 +1,28 @@ +module.exports = { + template: { + commit: ({message, url, author, name}) => `- [${message}](${url}) - ${author ? `@${author}` : name}`, + issue: "- {{name}} [{{text}}]({{url}})", + label: "[**{{label}}**]", + noLabel: "closed", + group: "\n#### {{heading}}\n", + changelogTitle: "# Changelog\n\n", + release: "## {{release}} ({{date}})\n{{body}}", + releaseSeparator: "\n---\n\n" + }, + groupBy: { + "Enhancements:": ["enhancement", "internal"], + "Bug Fixes:": ["bug"], + "Features": ["feature"] + }, + ignoreIssuesWith: [ + "skip-changelog" + ], + ignoreTagsWith: [ + "snapshot" + ], + dataSource: "prs", + changelogFileName: "CHANGELOG.gren.md", + tags: "all", + override: true, + generate: true +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 988f3842ee574418cd7e59af40aec30fa5b5cde9..4865ffefe074252a570a978129450c6c76b36957 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ * react-native 0.60 Support ### Breaking Change -This version requires an additional installation step in order to identify the correct build flavor on android, as described in our [Installation docs](https://github.com/wix/react-native-notifications/blob/master/docs/installation.md#step-5-rnnotifications-and-react-native-version). +This version requires an additional installation step in order to identify the correct build flavor on android, as described in our [Installation doc](https://github.com/wix/react-native-notifications/blob/master/docs/installation.md#step-5-rnnotifications-and-react-native-version). # 2.0.6 ## Fixed diff --git a/package.json b/package.json index 408c425c1ab22b54c7b18a1791e0eff5ddadd15d..b5c628689dad7f8a57bb0b2a4eaf5f40e06b8db6 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,8 @@ "jsc-android": "236355.x.x", "jest": "24.8.0", "metro-react-native-babel-preset": "0.55.x", - "react-native-typescript-transformer": "1.2.12" + "react-native-typescript-transformer": "1.2.12", + "github-release-notes": "0.17.0" }, "publishConfig": { "registry": "https://registry.npmjs.org/" diff --git a/scripts/release.js b/scripts/release.js index d5ad745143f4a55a3cb1231887c7a05c0df467c6..3d3067cd42020251de38003edbbd025ddb6d034c 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -3,7 +3,7 @@ const exec = require('shell-utils').exec; const semver = require('semver'); const fs = require('fs'); const _ = require('lodash'); -const path = require('path'); +const grenrc = require('../.grenrc'); // Workaround JS const isRelease = process.env.RELEASE_BUILD === 'true'; @@ -99,7 +99,7 @@ function tagAndPublish(newVersion) { exec.execSync(`git tag -a ${newVersion} -m "${newVersion}"`); exec.execSyncSilent(`git push deploy ${newVersion} || true`); if (isRelease) { - updatePackageJsonGit(newVersion); + updateGit(newVersion); } } @@ -115,14 +115,24 @@ function readPackageJson() { return JSON.parse(fs.readFileSync(getPackageJsonPath())); } -function updatePackageJsonGit(version) { +function updateGit(version) { exec.execSync(`git checkout ${BRANCH}`); + updatePackageJson(version); + generateChangelog(); + exec.execSync(`git commit -m "Update package.json version to ${version} and generate CHANGELOG.gren.md [ci skip]"`); + exec.execSync(`git push deploy ${BRANCH}`); +} + +function updatePackageJson(version) { const packageJson = readPackageJson(); packageJson.version = version; writePackageJson(packageJson); exec.execSync(`git add package.json`); - exec.execSync(`git commit -m"Update package.json version to ${version} [ci skip]"`); - exec.execSync(`git push deploy ${BRANCH}`); +} + +function generateChangelog() { + exec.execSync('gren changelog'); + exec.execSync(`git add ${grenrc.changelogFileName}`); } run();