Skip to content

Commit e69d9d7

Browse files
committed
chore(release): update release task to increment version, run validate, and pull latest
update the release documentation to reflect the new release process
1 parent 86701ec commit e69d9d7

File tree

3 files changed

+52
-27
lines changed

3 files changed

+52
-27
lines changed

scripts/README.md

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ Run `gulp build` or `gulp watch` to watch for changes.
2020

2121
### Building & Running e2e Tests
2222

23-
1. Run `gulp e2e` or `gulp watch.e2e` to watch for changes.
24-
2. Navigate to `http://localhost:8000/dist/e2e`
23+
1. Run `gulp e2e` or `gulp e2e.watch` with a folder passed to watch for changes.
24+
2. Navigate to `http://localhost:8080/dist/e2e`
2525

2626

2727
### Building & Running API Demos
2828

29-
1. Run `gulp demos` or `gulp watch.demos` to watch for changes.
30-
2. Navigate to `http://localhost:8000/dist/demos`
29+
1. Run `gulp demos` or `gulp demos.watch` with a folder passed to watch for changes.
30+
2. Navigate to `http://localhost:80808080/dist/demos`
3131

3232

3333
### Building API Docs
@@ -62,39 +62,50 @@ To remove the linked version of `ionic-angular` do `npm rm ionic-angular`, and t
6262

6363
### Running Tests
6464

65-
1. `gulp karma`
65+
1. `gulp validate`
66+
6667

6768
### Running Sass Linter
6869

69-
1. See the [Sass Guidelines](https://github.com/driftyco/ionic/blob/master/CONTRIBUTING.md#sass-guidelines) for editing Sass and running the linter.
70+
**Requires Ruby. Skip this step entirely if you are unable to install Ruby.**
7071

71-
# Releasing
72+
1. See the [Sass Guidelines](https://github.com/driftyco/ionic/blob/master/.github/CONTRIBUTING.md#sass-changes) for editing the Sass.
73+
2. Install the linter: `gem install scss_lint`
74+
3. Run `gulp lint.sass` and fix any linter errors.
7275

73-
### Releasing Ionic Source
7476

75-
1. Run `gulp prerelease`
76-
- Pulls latest
77-
- updates package.json minor version
78-
- updates changelog
79-
- builds npm package files into dist
77+
### Running TypeScript Linter
8078

81-
2. Verify that changelog changes and package.json update are correct (`git status` && `git diff`)
82-
3. Run [snapshot](#running-snapshot) & update if necessary
83-
4. Commit and push
84-
5. Run `gulp release`
85-
- publishes to npm
86-
- Creates a new tag and release on Github
79+
1. Run `gulp lint.ts` and fix any errors.
8780

88-
6. Sit back and have a beer :beer: (or wine :wine_glass:)
8981

82+
# Releasing
83+
84+
### Releasing Ionic Source
85+
86+
1. Run [snapshot](#running-snapshot) & verify all changes are intentional, update master snapshot if so
87+
2. Run `gulp release`
88+
- Pulls latest from GitHub
89+
- Runs `gulp validate`
90+
- Builds npm package files into dist
91+
- Updates package.json version
92+
- Removes debug statements
93+
- Updates changelog
94+
- Publishes to npm
95+
- Creates a new tag and release on Github
96+
3. Verify that the `changelog` changes are accurate and the `package.json` version is correct (`git status` && `git diff`)
97+
4. Commit and push
98+
5. Sit back and have a beer :beer: (or wine :wine_glass:)
9099

91100
### Publish a nightly release
92-
1. Run `gulp publish.nightly`
93-
- Pulls latest
94-
- builds npm package files into dist
95-
- updates package.json to a nightly version for publish: 0.1.0-beta.0 results in 0.1.0-beta.0-r8e7684t
96-
- publishes to NPM using the nightly tag
101+
1. Run `gulp nightly`
102+
- Pulls latest from GitHub
103+
- Runs `gulp validate`
104+
- Builds npm package files into dist
105+
- Removes debug statements
106+
- Publishes to npm using the `nightly` tag with the date/time of publish added to the version: `2.0.0-rc.0` results in `2.0.0-rc.0-201610131811`
97107
2. `npm install ionic-angular@nightly` will now install the latest nightly release
108+
3. Run `npm view ionic-angular` to see the latest nightly release
98109

99110

100111
### Releasing Component Demos

scripts/gulp/declarations.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ declare module 'rollup-plugin-commonjs';
1414
declare module 'rollup-plugin-multi-entry';
1515
declare module 'rollup-plugin-node-resolve';
1616
declare module 'rollup-plugin-uglify';
17+
declare module 'semver';
1718
declare module 'vinyl';
1819
declare module 'yargs';

scripts/gulp/tasks/release.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,26 @@ import { rollup } from 'rollup';
99
import * as commonjs from 'rollup-plugin-commonjs';
1010
import * as nodeResolve from 'rollup-plugin-node-resolve';
1111
import * as runSequence from 'run-sequence';
12+
import * as semver from 'semver';
1213
import { obj } from 'through2';
1314

1415
import { DIST_BUILD_UMD_BUNDLE_ENTRYPOINT, DIST_BUILD_ROOT, DIST_BUNDLE_ROOT, PROJECT_ROOT, SCRIPTS_ROOT, SRC_ROOT } from '../constants';
1516
import { compileSass, copyFonts, createTimestamp, setSassIonicVersion, writePolyfills } from '../util';
1617

1718

1819
task('nightly', (done: (err: any) => void) => {
19-
runSequence('release.prepareReleasePackage',
20+
runSequence('release.pullLatest',
21+
'validate',
22+
'release.prepareReleasePackage',
2023
'release.removeDebugStatements',
2124
'release.publishNightly',
2225
done);
2326
});
2427

2528
task('release', (done: (err: any) => void) => {
26-
runSequence('release.prepareReleasePackage',
29+
runSequence('release.pullLatest',
30+
'validate',
31+
'release.prepareReleasePackage',
2732
'release.copyProdVersion',
2833
'release.removeDebugStatements',
2934
'release.prepareChangelog',
@@ -97,7 +102,15 @@ task('release.publishNpmRelease', (done: Function) => {
97102
});
98103

99104
task('release.copyProdVersion', () => {
105+
// Increment the version and update the source package file
100106
const sourcePackageJSON = require(`${PROJECT_ROOT}/package.json`);
107+
108+
sourcePackageJSON.version = semver.inc(sourcePackageJSON.version, 'prerelease', true);
109+
110+
const sourcePrettyPrintedJson = JSON.stringify(sourcePackageJSON, null, 2);
111+
writeFileSync(`${PROJECT_ROOT}/package.json`, sourcePrettyPrintedJson);
112+
113+
// Copy the source package version and update it in the build package file
101114
const packageJsonToUpdate = require(`${DIST_BUILD_ROOT}/package.json`);
102115

103116
packageJsonToUpdate.version = sourcePackageJSON.version;

0 commit comments

Comments
 (0)