Skip to content

Commit 0332b8a

Browse files
authored
Merge pull request #1789 from NativeScript/svetoslavtsenov/release-cycle-docs
docs: update contribution change log
2 parents d4739f5 + 1d70d51 commit 0332b8a

File tree

3 files changed

+89
-20
lines changed

3 files changed

+89
-20
lines changed

Diff for: CONTRIBUTING.md

+89-20
Original file line numberDiff line numberDiff line change
@@ -81,36 +81,105 @@ If you want to contribute, but you are not sure where to start - look for [issue
8181

8282
## Publishing new versions
8383

84-
Instructions how to publish a new version for Maintainers.
8584

86-
1. Execute `npm install` to install dependencies and prepare the package for publishing:
87-
```bash
88-
cd nativescript-angular/nativescript-angular
89-
npm install
85+
## <a name="release"></a> Releasing new versions
86+
Instructions how to release a new version for **NativeScript Core Team Members**.
87+
88+
![](./release-contribution-guide-schema-webpack.png?raw=true)
89+
90+
1. Checkout release branch
91+
```
92+
cd nativescript-angular/nativescript-angular && git checkout release && git pull
93+
```
94+
#### If we prepare major or minor release, merge master in release branch else **skip this step**.
9095
```
96+
git merge --ff-only origin/master
97+
```
98+
*** Note: If there are commits in release branch which are not merged in master branch '-ff-merge' command will fail.
99+
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.
91100

92-
2. Add the following to your `.npmrc`:
101+
2. Execute `npm i` to install dependencies:
102+
```
103+
cd nativescript-angular && npm i
104+
```
105+
3. Execute [`npm version`](https://docs.npmjs.com/cli/version) to bump the version:
106+
```
107+
npm --no-git-tag-version version [patch|minor|major] -m "release: cut the %s release"
108+
```
109+
or
93110
```
94-
tag-version-prefix=""
95-
message="release: cut the %s release"
111+
npm --no-git-tag-version version [version] --allow-same-version -m "release: cut the %s release"
96112
```
113+
NOTE: Check the changelog!!!
97114

98-
3. Create new branch for the release:
99-
```bash
100-
git checkout -b username/release-version
115+
4. Create release-branch with change log
116+
```
117+
git checkout -b release-[version]
118+
```
119+
5. Add changes
101120
```
121+
git add changed-files
122+
git commit -m "release: cut the %s release"
123+
git push
124+
```
125+
NOTE: Make sure the PR is based on release branch
102126

103-
4. Execute [`npm version`](https://docs.npmjs.com/cli/version) to bump the version in the `package.json` file, tag the release and update the CHANGELOG.md:
104-
```bash
105-
npm version [patch|minor|major]
127+
6. Merge PR into release branch.
128+
129+
7. The merge will produce package with rc tag in npm. If all checks have passed, publish official package. Usually the night builds will be triggered and the package will be ready to be released on the next day.
130+
131+
8. Don't forget to tag the release branch
132+
```
133+
git tag [version]
134+
git push --tags
135+
```
136+
Only if needed to Tips to remove tags:
137+
```
138+
git push --delete origin [version]
139+
git tag -d [version]
106140
```
107141

108-
5. Push all the changes to your branch and create a pull request:
109-
```bash
110-
git push --set-upstream origin username/release-version --tags
142+
## Checkout master branch and bump version usually should be minor or major.
143+
144+
## Merge changes from release into master
145+
146+
## NOTE: Don't use git IDE/WEB
147+
148+
![](./merge-guidance-schema.png)
149+
150+
### Here are steps described in the diagram above.
151+
152+
1. Make sure you are in release branch:
153+
```
154+
git checkout release && git pull
155+
```
156+
2. Create PR to merge changes back in master and preserve history:
111157
```
158+
git checkout -b merge-release-in-master-[branch]/[sha]
159+
git push --set-upstream origin merge-release-in-master-branch-[branch]/[sha]
160+
git merge origin/master
161+
```
162+
3. Resolve conflicts. Choose to keep the version of master branch. If it is needed to revert versions of modules, see at the bottom.
112163

113-
6. Publish the package to `npm` after the pull request is merged:
114-
```bash
115-
npm publish
164+
4. Add conflicts:
165+
```
166+
git add resolved files
167+
```
168+
5. Commit changes with default merge message:
169+
```
170+
git commit
171+
git push
172+
```
173+
174+
6. Create pull request which should be based on master. Replace replace env merge-release-in-master-branch with its value
175+
```
176+
curl -d '{"title": "chore: merge release in master","body": "chore: merge release in master","head": "merge-release-in-master","base": "master"}' -X POST https://api.github.com/repos/NativeScript/NativeScript/pulls -H "Authorization: token ${GIT_TOKEN}"
177+
```
178+
179+
**If needed, to revert file and take it from master:**
180+
```
181+
git checkout origin/master nativescript-angular/[some-file]
182+
git commit --amend
183+
git push --force-with-lease
116184
```
185+
This could require to repeat steps from 1 to 4, since we need to keep the branches with the same history

Diff for: merge-guidance-schema.png

63.1 KB
Loading

Diff for: release-contribution-guide-schema-webpack.png

94.7 KB
Loading

0 commit comments

Comments
 (0)