Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit a29b9c2

Browse files
Merge pull request #834 from NativeScript/svetoslavtsenov/update-release-schema
docs: update release schema
2 parents 69cb061 + cc188f7 commit a29b9c2

File tree

3 files changed

+81
-16
lines changed

3 files changed

+81
-16
lines changed

Diff for: CONTRIBUTING.md

+81-16
Original file line numberDiff line numberDiff line change
@@ -149,34 +149,99 @@ Thank you for your contribution!
149149
150150
## Publishing new versions
151151
152-
1. Run `npm install` to install the dependencies and prepare the package for publishing.
153-
```bash
154-
npm install
152+
153+
## <a name="release"></a> Releasing new versions
154+
Instructions how to release a new version for **NativeScript Core Team Members**.
155+
156+
![](./release-contribution-guide-schema-webpack.png?raw=true)
157+
158+
1. Checkout release branch
159+
```
160+
git checkout release && git pull
155161
```
162+
#### If we prepare major or minor release, merge master in release branch else **skip this step**.
163+
```
164+
git merge --ff-only origin/master
165+
```
166+
*** Note: If there are commits in release branch which are not merged in master branch '-ff-merge' command will fail.
167+
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.
156168
157-
2. Add the following to your `.npmrc`.
169+
2. Execute `npm i` to install dependencies:
170+
```
171+
npm i
172+
```
173+
3. Execute [`npm version`](https://docs.npmjs.com/cli/version) to bump the version:
158174
```
159-
tag-version-prefix=""
160-
message="release: cut the %s release"
175+
npm --no-git-tag-version version [patch|minor|major] -m "release: cut the %s release"
161176
```
177+
or
178+
```
179+
npm --no-git-tag-version version [version] --allow-same-version -m "release: cut the %s release"
162180
163-
3. Create new branch for the release:
164181
```
165-
git checkout -b username/release-version
182+
7. Create release-branch with change log
183+
```
184+
git checkout -b release-[release-version]
166185
```
167186
168-
4. Run `npm version` to bump the version in the `package.json`, tag the release and update the CHANGELOG.md:
187+
7. Add changes
188+
```
189+
git add changed-files
190+
git commit -m "release: cut the %s release"
191+
git push
192+
```
193+
8. Create git tag
169194
```
170-
npm version [patch|minor|major]
195+
git tag release-version
196+
git push --tags
171197
```
198+
9. Create a pull request from git in web or try to use script below. Be careful to base your branch on the correct "release" branch
199+
```
200+
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-dev-webpack/pulls -H "Authorization: token ${GIT_TOKEN}"
201+
```
202+
10. Merge PR into release branch.
203+
204+
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.
172205
173-
5. Push all changes to your branch and create a PR.
174-
```bash
175-
git push --set-upstream origin username/release-version --tags
206+
## Merge changes from release into master
207+
208+
![](./merge-guidance-schema.png)
209+
210+
### Here are steps described in the diagram above.
211+
212+
1. Make sure you are in release branch:
213+
```
214+
git checkout release
215+
git pull
216+
```
217+
2. Create PR to merge changes back in master and preserve history:
218+
```
219+
export MERGE_BRANCH='merge-release-in-master'
220+
git checkout -b ${MERGE_BRANCH}
221+
git push --set-upstream origin ${MERGE_BRANCH}
222+
git merge origin/master
223+
```
224+
3. Resolve conflicts. Choose to keep the version of master branch. If it is needed to revert versions of modules, see at the bottom.
225+
226+
4. Add conflicts:
227+
```
228+
git add resolved files
229+
```
230+
5. Commit changes with default merge message:
231+
```
232+
git commit
233+
git push
176234
```
177235
178-
6. Publish the package to npm after the PR is merged.
179-
```bash
180-
npm publish
236+
6. Create pull request. Replace replace env ${MERGE_BRANCH} with its value
237+
```
238+
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}"
181239
```
182240
241+
**If needed, revert version of modules and platform declarations to take the one from master:**
242+
```
243+
git checkout origin/master tns-platform-declarations/package.json tns-core-modules/package.json
244+
git commit --amend
245+
git push --force-with-lease
246+
```
247+
This will 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)