Skip to content

Commit 91ec2c8

Browse files
committed
chore(release): setup auto-release for canary and stable (#50)
1 parent 0c498b7 commit 91ec2c8

File tree

5 files changed

+2797
-240
lines changed

5 files changed

+2797
-240
lines changed

.circleci/config.yml

+47-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ repo_cache: &repo_cache
99
deps_cache: &deps_cache
1010
key: v1-dependencies-{{ checksum "yarn.lock" }}
1111

12+
build_cache: &build_cache
13+
key: v1-build-{{ .Environment.CIRCLE_SHA1 }}
14+
1215
version: 2
1316
jobs:
1417
checkout_code:
@@ -65,10 +68,35 @@ jobs:
6568
- restore_cache: *repo_cache
6669
- restore_cache: *deps_cache
6770
- run: yarn build
71+
- save_cache:
72+
paths:
73+
- packages/example-app/dist
74+
- packages/form/dist
75+
- packages/router/dist
76+
- packages/store/dist
77+
<<: *build_cache
78+
79+
release_canary:
80+
<<: *defaults
81+
steps:
82+
- restore_cache: *repo_cache
83+
- restore_cache: *deps_cache
84+
- restore_cache: *build_cache
85+
# Add --yes flag once verified
86+
- run: yarn release:canary
87+
88+
release_stable:
89+
<<: *defaults
90+
steps:
91+
- restore_cache: *repo_cache
92+
- restore_cache: *deps_cache
93+
- restore_cache: *build_cache
94+
# Add --yes flag once verified
95+
- run: yarn release:stable:ci
6896

6997
workflows:
7098
version: 2
71-
build:
99+
build_and_deploy:
72100
jobs:
73101
- checkout_code
74102
- install_dependencies:
@@ -83,3 +111,21 @@ workflows:
83111
- build:
84112
requires:
85113
- install_dependencies
114+
- release_canary:
115+
requires:
116+
- lint
117+
- test
118+
- build
119+
filters:
120+
branches:
121+
only: master
122+
- release_stable:
123+
requires:
124+
- lint
125+
- test
126+
- build
127+
filters:
128+
branches:
129+
ignore: /.*/
130+
tags:
131+
only: /^v.*/

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//registry.npmjs.org/:_authToken=${NPM_TOKEN}

lerna.json

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
{
2-
"lerna": "2.11.0",
32
"packages": ["packages/*"],
4-
"version": "0.0.0",
3+
"version": "9.0.0",
54
"npmClient": "yarn",
65
"useWorkspaces": true,
76
"ignore": "example-app",
7+
"ignoreChanges": ["**/*.spec.ts", "**/*.md"],
88
"command": {
99
"init": {
1010
"exact": true
11+
},
12+
"publish": {
13+
"npmClient": "yarn",
14+
"allowBranch": "master",
15+
"message": "chore(release): publish %s"
16+
},
17+
"version": {
18+
"conventionalCommits": true,
19+
"signGitCommit": true,
20+
"signGitTag": true
1121
}
1222
}
1323
}

package.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"name": "platform",
23
"private": true,
34
"workspaces": [
45
"packages/*"
@@ -8,12 +9,15 @@
89
"build:store": "ng-packagr -p packages/store",
910
"build:form": "ng-packagr -p packages/form",
1011
"build:router": "ng-packagr -p packages/router",
12+
"release:canary": "lerna publish --canary --npm-tag next",
13+
"release:stable": "lerna version",
14+
"release:stable:ci": "lerna publish from-git",
1115
"clean": "npm-run-all -p clean:*",
1216
"clean:deps": "npm-run-all -p clean:deps:*",
1317
"clean:deps:workspace": "rimraf node_modules",
1418
"clean:deps:packages": "rimraf packages/*/node_modules",
1519
"clean:coverage": "rimraf coverage",
16-
"clean:package-dist": "rimraf packages/*/dist",
20+
"clean:dist": "rimraf packages/*/dist",
1721
"lint": "npm-run-all -p lint:*",
1822
"lint:packages": "tslint -p tsconfig.json",
1923
"lint:prettier": "prettier -l \"**/*.*(ts|js|css|scss|json|md)\"",
@@ -53,7 +57,7 @@
5357
"jest-junit": "5.1.0",
5458
"jest-preset-angular": "6.0.0",
5559
"jest-zone-patch": "0.0.8",
56-
"lerna": "2.11.0",
60+
"lerna": "3.4.3",
5761
"lint-staged": "7.2.0",
5862
"ng-packagr": "3.0.6",
5963
"npm-run-all": "4.1.3",

0 commit comments

Comments
 (0)