mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-14 18:12:09 +08:00
docs: update changelog (#7004)
This commit is contained in:
@ -67,7 +67,7 @@ git checkout -b <my-fix-branch> master
|
|||||||
|
|
||||||
5. Before you submit your PR:
|
5. Before you submit your PR:
|
||||||
- Rebase your changes to the latest master: `git pull --rebase upstream master`.
|
- Rebase your changes to the latest master: `git pull --rebase upstream master`.
|
||||||
- Ensure all unit test are green for Android and iOS. Check [running unit tests](DevelopmentWorkflow.md#running-unit-tests).
|
- Ensure all unit test are green for Android and iOS. Check [running unit tests](DevelopmentWorkflow.md#running-unit-tests).
|
||||||
- Ensure your changes pass tslint validation. (run `npm run tslint` in the root of the repo).
|
- Ensure your changes pass tslint validation. (run `npm run tslint` in the root of the repo).
|
||||||
|
|
||||||
6. Push your fork. If you have rebased you might have to use force-push your branch:
|
6. Push your fork. If you have rebased you might have to use force-push your branch:
|
||||||
@ -223,32 +223,26 @@ Instructions how to release a new version for **NativeScript Core Team Members**
|
|||||||
```
|
```
|
||||||
git checkout release
|
git checkout release
|
||||||
```
|
```
|
||||||
2. Create a PR to cut the release:
|
#### If we prepare major or minor release, merge master in release branch else **skip this step**.
|
||||||
```
|
```
|
||||||
export RELEASE_VERSION=version
|
git merge --ff-only origin/master
|
||||||
export BRANCH="release-${RELEASE_VERSION}"
|
|
||||||
git checkout -b ${BRANCH}
|
|
||||||
git push --set-upstream origin ${BRANCH}
|
|
||||||
```
|
```
|
||||||
#### Merge master in release branch or cherry-pick commits. If the commits are in release branch **skip this step**.
|
*** Note: If there are commits in release branch which are not merged in master branch '-ff-merge' command will fail.
|
||||||
```
|
In this case the commits should be merge firstly from release in master branch as explained in section 'Merge changes from release into master' and then repeat step 1.
|
||||||
git merge --ff-only origin/master or git cherry-pick commit-sha
|
|
||||||
git push --set-upstream origin prep-release-version
|
2. Execute `npm i` to install dependencies:
|
||||||
```
|
|
||||||
3. Execute `npm i` to install dependencies:
|
|
||||||
```
|
```
|
||||||
npm i
|
npm i
|
||||||
```
|
```
|
||||||
4. Execute [`npm version`](https://docs.npmjs.com/cli/version) to bump the version of `tns-platform-declarations`:
|
3. Execute [`npm version`](https://docs.npmjs.com/cli/version) to bump the version of `tns-platform-declarations`:
|
||||||
```
|
```
|
||||||
cd tns-platform-declarations
|
cd tns-platform-declarations
|
||||||
npm --no-git-tag-version version [major|minor|patch] -m "release: cut the %s release"
|
npm --no-git-tag-version version [major|minor|patch] -m "release: cut the %s release"
|
||||||
cd ..
|
cd ..
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Execute [`npm version`](https://docs.npmjs.com/cli/version) to bump the version of `tns-core-modules`,
|
4. Execute [`npm version`](https://docs.npmjs.com/cli/version) to bump the version of `tns-core-modules`,
|
||||||
tag the release and update the CHANGELOG.md.
|
tag the release and update the CHANGELOG.md. Don't forget to check the auto-generated CHANGELOG.md
|
||||||
In case we need to publish release version we need simply to use npm version x.x.x-rc
|
|
||||||
```
|
```
|
||||||
cd tns-core-modules
|
cd tns-core-modules
|
||||||
npm --no-git-tag-version version [major|minor|patch] -m "release: cut the %s release"
|
npm --no-git-tag-version version [major|minor|patch] -m "release: cut the %s release"
|
||||||
@ -257,6 +251,11 @@ cd ..
|
|||||||
6. Set correct version of **tns-core-modules-widgets** in tns-core-modules/package.json.
|
6. Set correct version of **tns-core-modules-widgets** in tns-core-modules/package.json.
|
||||||
Usually tns-core-modules-widgets should already have been released and we need to set the official version.
|
Usually tns-core-modules-widgets should already have been released and we need to set the official version.
|
||||||
|
|
||||||
|
7. Create release-branch with change log
|
||||||
|
```
|
||||||
|
git checkout -b release-[release-version]
|
||||||
|
```
|
||||||
|
|
||||||
7. Add changes
|
7. Add changes
|
||||||
```
|
```
|
||||||
git add changed-files
|
git add changed-files
|
||||||
@ -268,13 +267,13 @@ git push
|
|||||||
git tag release-version
|
git tag release-version
|
||||||
git push --tags
|
git push --tags
|
||||||
```
|
```
|
||||||
9. Create a pull request. Replace env variables ${RELEASE_VERSION} and ${BRANCH} with their values
|
9. Create a pull request. Be careful to base your branch on the correct branch
|
||||||
```
|
```
|
||||||
curl -d '{"title": "release: cut the ${RELEASE_VERSION} release","body": "docs: update changelog","head": "${BRANCH}","base": "release"}' -X POST https://api.github.com/repos/NativeScript/NativeScript/pulls -H "Authorization: token ${GIT_TOKEN}"
|
curl -d '{"title": "release: cut the [release-version] release","body": "docs: update changelog","head": "${BRANCH}","base": "release"}' -X POST https://api.github.com/repos/NativeScript/NativeScript/pulls -H "Authorization: token ${GIT_TOKEN}"
|
||||||
```
|
```
|
||||||
10. Merge PR into release branch.
|
10. Merge PR into release branch.
|
||||||
|
|
||||||
11. If all checks has passed publish package.
|
11. If all checks has passed publish package. Usually the night builds will be triggered and the package will be ready to be released on the next day.
|
||||||
|
|
||||||
## Merge changes from release into master
|
## Merge changes from release into master
|
||||||
|
|
||||||
|
18
build/create-release-changelog-pr.js
Normal file
18
build/create-release-changelog-pr.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
const { readFileSync } = require("fs");
|
||||||
|
const { resolve } = require("path");
|
||||||
|
const { createPR, argsParser, gitBranch } = require("./pr-helper");
|
||||||
|
|
||||||
|
const currentBranch = argsParser().currentBranch || gitBranch;
|
||||||
|
const modulesPackageVersion = argsParser().packageVersion || JSON.parse(readFileSync(resolve(process.cwd(), "tns-core-modules/package.json")).toString()).version;
|
||||||
|
const title = argsParser().title || `release: cut the ${modulesPackageVersion} release`;
|
||||||
|
const baseBranch = argsParser().base || "release";
|
||||||
|
const body = argsParser().body || "docs: update changelog";
|
||||||
|
|
||||||
|
const postQuery = {
|
||||||
|
"body": body,
|
||||||
|
"head": currentBranch,
|
||||||
|
"base": baseBranch,
|
||||||
|
"title": title
|
||||||
|
}
|
||||||
|
|
||||||
|
createPR(postQuery);
|
9
build/merge-release-in-master-pr.js
Normal file
9
build/merge-release-in-master-pr.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
const { createPR, gitBranch } = require("./pr-helper");
|
||||||
|
|
||||||
|
const postQuery = {
|
||||||
|
"head": gitBranch,
|
||||||
|
"base": "master",
|
||||||
|
"title": "chore: merge release in master"
|
||||||
|
}
|
||||||
|
|
||||||
|
createPR(postQuery);
|
39
build/pr-helper.js
Normal file
39
build/pr-helper.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
const { execSync } = require('child_process');
|
||||||
|
const { writeFileSync, unlinkSync } = require("fs");
|
||||||
|
const { resolve } = require("path");
|
||||||
|
|
||||||
|
exports.gitBranch = execSync("git branch").toString()
|
||||||
|
.split("\n")
|
||||||
|
.filter(f => f.trim().startsWith("*"))[0]
|
||||||
|
.replace("*", "").trim();
|
||||||
|
|
||||||
|
exports.createPR = (postQuery) => {
|
||||||
|
if (!process.env.GIT_TOKEN) {
|
||||||
|
console.error("Missing env variable GIT_TOKEN");
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
const releaseDataJsonPath = resolve(process.cwd(), "git-helper.json");
|
||||||
|
writeFileSync(releaseDataJsonPath, JSON.stringify(postQuery));
|
||||||
|
const result = execSync(` curl -d "@${releaseDataJsonPath}" -X POST https://api.github.com/repos/NativeScript/NativeScript/pulls -H "Authorization: token ${process.env.GIT_TOKEN}" `);
|
||||||
|
console.log(result.toString());
|
||||||
|
unlinkSync(releaseDataJsonPath);
|
||||||
|
|
||||||
|
const requesResultJson = JSON.parse(result);
|
||||||
|
execSync(`open ${requesResultJson.html_url}`);
|
||||||
|
|
||||||
|
return requesResultJson;
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.argsParser = () => {
|
||||||
|
args = {};
|
||||||
|
process.argv
|
||||||
|
.filter(a => a.startsWith("--"))
|
||||||
|
.map(el => {
|
||||||
|
el = el.split("=");
|
||||||
|
const prop = el[0].replace("--", "").replace("-", "").trim();
|
||||||
|
const value = el[1].trim();
|
||||||
|
args[prop] = value;
|
||||||
|
});
|
||||||
|
|
||||||
|
return args;
|
||||||
|
}
|
Binary file not shown.
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 73 KiB |
Binary file not shown.
Before Width: | Height: | Size: 296 KiB After Width: | Height: | Size: 107 KiB |
Reference in New Issue
Block a user