Skip to content

Commit fac8738

Browse files
castastrophemwcz
authored andcommitted
Documenting release steps (#379)
* Documenting release steps * Apply code review feedback * add doc for new release script
1 parent 71994f9 commit fac8738

File tree

1 file changed

+62
-2
lines changed

1 file changed

+62
-2
lines changed

docs/content/develop/step-4.md

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
2-
title = "Publish"
2+
title = "Tagging and Publishing Releases"
33
description = ""
44
weight = 9
55
draft = false
@@ -9,6 +9,66 @@ menu = "develop"
99
tags = [ "develop" ]
1010
+++
1111

12+
## The release script
1213

14+
These instructions describe how to create a new release of PatternFly Elements.
15+
They are intended for core maintainers who have admin rights to the
16+
[@patternfly][pforg] org on npm.
1317

14-
We've been publishing our PatternFly Elements to the [@patternfly organization](https://www.npmjs.com/org/patternfly) on npm.
18+
To tag and publish a new release, run:
19+
20+
```
21+
npm run release
22+
```
23+
24+
Here's a summary of what to expect the release script to do:
25+
26+
- ask you a question about what version bump type to perform (major, minor, etc)
27+
- do a fresh npm install
28+
- do a build
29+
- create a new branch (ex: `release/v1.0.0`)
30+
- create a new tag (ex: `v1.0.0`)
31+
- publish all elements npm (you will be prompted `Y/n` before this happens)
32+
- create a pull request for the reelase branch
33+
- the PR will be created automatically if you have [hub][hub] installed, otherwise a link to create the PR will be printed in the terminal
34+
- the purpose of the pull request is to bring the new version numbers back into `master`
35+
36+
### Version bumps & prereleases
37+
38+
The types of version bumps are more-or-less straightforward. The least intuitive one is if you want to bump a prerelease version, for example from `1.0.0-prerelease.2` to `1.0.0-prerelease.3`. In that case only, choose *Custom Prerelease*.
39+
40+
## (Legacy) The Hard Way
41+
42+
Before the release script (above) was created, we published releases using the manual steps below. They're kept here mostly for posterity, and possibly to make the [release script](https://github.com/patternfly/patternfly-elements/blob/master/scripts/release.sh) more understandable.
43+
44+
To roll a new release, use the following steps:
45+
46+
1. Start in the root directory of the patternfly-elements project.
47+
2. Check out the master branch and pull down the latest:
48+
- `git reset --hard && git clean -df && git checkout master && git fetch origin && git pull`
49+
3. To have lerna bump the verions, run: `npm run lerna version -- --no-git-tag-version --no-push --preid prerelease`.
50+
- Choose the appropriate version bump type for the release you're publishing:
51+
- if bumping a prerelease version (example: from 1.0.0-prerelease.2 to 1.0.0-prerelease.3), choose *Custom Prerelease*
52+
4. Assign that version to this variable for use below: `$NEW_VERSION="1.0.0-prerelease.3"`.
53+
5. Create a new branch: `git checkout -b release/$NEW_VERSION` (example: release/1.0.0-prerelease.3).
54+
5. Run a fresh install, build all the assets, and then force add those assets for the tag release:
55+
- `npm install && npm run build && git add elements/*/*.{js,map,css} -f`
56+
6. Commit the updates: `git commit -am "$NEW_VERSION"`
57+
7. Roll the tag: `git tag "v$NEW_VERSION"`
58+
8. Remove the bundle files:
59+
- `for e in elements/*; do find $e -maxdepth 1 \( -not -name "gulpfile.js" -not -name "rollup.config.js" \) \( -name "*.js" -or -name "*.css" -or -name "*.map" \) -exec git rm -f {} \; ;done`
60+
9. Commit: `git commit -am "Remove bundles from $NEW_VERSION"`
61+
10. Push up to origin: `git push origin release/$NEW_VERSION -u`
62+
11. Push up the tag: `git push --tags`
63+
12. Checkout master and reset:
64+
- `git checkout master`
65+
- `git reset --hard origin/master`
66+
13. [Create a pull request](https://github.com/patternfly/patternfly-elements/compare) for the branch you just created.
67+
14. Delete branch after merging pull request:
68+
- `git branch -D release/$NEW_VERSION`
69+
15. To publish to npm (you will have to have the right credentials to do this):
70+
- Checkout the tag release you just rolled: `git checkout v$NEW_VERSION`
71+
- From that code, run the lerna publishing task: `npm run lerna publish from-git`
72+
73+
[pforg]: https://www.npmjs.com/org/patternfly
74+
[hub]: https://hub.github.com

0 commit comments

Comments
 (0)