diff --git a/.scripts/README.md b/.scripts/README.md index e7e8ddea1a..6f5c3eb8cc 100644 --- a/.scripts/README.md +++ b/.scripts/README.md @@ -1,16 +1,16 @@ # Build Scripts -## Deploy +## Release The deploy scripts at the root, make a new release of all the packages in this monorepo. All packages will be released with the same version. In order to make a new release: -1. `npm run prepare.deploy` +1. `npm run release.prepare` 2. Review/update changelog 3. Commit updates using the package name and version number as the commit message. -4. `npm run deploy` +4. `npm run release` 5. :tada: diff --git a/.scripts/publish.js b/.scripts/release.js similarity index 84% rename from .scripts/publish.js rename to .scripts/release.js index ec595741c5..fc51be79b5 100644 --- a/.scripts/publish.js +++ b/.scripts/release.js @@ -60,22 +60,24 @@ async function publishPackages(packages, version) { ); }); - // push commits and tags to git remote - publishGit(version); + // push tag to git remote + publishGitTag(tasks, version); const listr = new Listr(tasks); await listr.run(); } -function publishGit(tasks, version) { +function publishGitTag(tasks, version) { + const tag = `v${version}`; + tasks.push( { - title: 'Tagging the latest commit', - task: () => execa('git', ['tag', `v${version}`], { cwd: common.rootDir }) + title: `Tag latest commit ${chalk.dim(`(${tag})`)}`, + task: () => execa('git', ['tag', `${tag}`], { cwd: common.rootDir }) }, { - title: 'Pushing to Github', + title: 'Push tag to Github', task: () => execa('git', ['push', '--follow-tags'], { cwd: common.rootDir }) } ); diff --git a/angular/package.json b/angular/package.json index d238075720..51505081db 100644 --- a/angular/package.json +++ b/angular/package.json @@ -28,8 +28,10 @@ "ionic-core": "node ../core/node_modules/.bin/stencil build", "ionic-core-dev": "node ../core/node_modules/.bin/stencil build --dev", "lint": "tslint --project .", + "prerelease": "npm run validate && np prerelease --yolo --any-branch --tag next", "test": "echo 'angular no tests yet'", - "tsc": "tsc -p ." + "tsc": "tsc -p .", + "validate": "npm i && npm run lint && npm run test && npm run build" }, "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/package.json b/package.json index aea92386ca..54c13707c1 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "description": "Ionic mono-repo root package.json, used mainly to execute build scripts. This package is not published to npm.", "private": true, "scripts": { - "prepare.deploy": "node .scripts/prepare.js", - "deploy": "node .scripts/publish.js", + "release.prepare": "node .scripts/prepare.js", + "release": "node .scripts/release.js", "changelog": "conventional-changelog -p angular -i ./CHANGELOG.md -k core -s" }, "devDependencies": {