Skip to content

Commit 978bb60

Browse files
committed
chore(release): setup auto-release for canary and stable (#50)
1 parent cc7e2d6 commit 978bb60

File tree

6 files changed

+2813
-242
lines changed

6 files changed

+2813
-242
lines changed

.circleci/config.yml

+46-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,34 @@ 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+
- run: yarn release:canary --yes
86+
87+
release_stable:
88+
<<: *defaults
89+
steps:
90+
- restore_cache: *repo_cache
91+
- restore_cache: *deps_cache
92+
- restore_cache: *build_cache
93+
# Add --yes flag once verified
94+
- run: yarn release:stable:ci
6895

6996
workflows:
7097
version: 2
71-
build:
98+
build_and_deploy:
7299
jobs:
73100
- checkout_code
74101
- install_dependencies:
@@ -83,3 +110,21 @@ workflows:
83110
- build:
84111
requires:
85112
- install_dependencies
113+
- release_canary:
114+
requires:
115+
- lint
116+
- test
117+
- build
118+
filters:
119+
branches:
120+
only: master
121+
- release_stable:
122+
requires:
123+
- lint
124+
- test
125+
- build
126+
filters:
127+
branches:
128+
ignore: /.*/
129+
tags:
130+
only: /^v.*/

.npmrc

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

CONTRIBUTING.md

+15
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,18 @@ This repo utilizes [Yarn Workspaces](https://yarnpkg.com/lang/en/docs/workspaces
77
## Commit Message Guidelines
88

99
We follow the [Conventional Commits](https://conventionalcommits.org/) guidelines. These are enforced through the use of [commitlint](http://marionebl.github.io/commitlint). If you would like a more interactive way of formatting your commit messages, run `yarn commit` once your changes are staged.
10+
11+
## Releases
12+
13+
## Canary Releases
14+
15+
This repo is setup to automatically release canary builds for every commit that is pushed to master. In order to access those builds, run `npm install @angular-redux/store@next` (or whichever package you are looking to use)
16+
17+
## Stable Releases
18+
19+
For stable releases, the build and publishing is done automatically for CircleCI. If you have write access to the repo, run the following steps to automatically release a new version to `latest`
20+
21+
- Pull down the latest version of master to your local machine
22+
- Run `yarn release:stable`
23+
24+
The release commit will be automatically pushed to `master` where CircleCI will complete the remaining publishing steps.

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

+8-4
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)\"",
@@ -22,8 +26,8 @@
2226
"test:watch": "jest --watch",
2327
"commit": "commit",
2428
"prettier": "prettier --write \"**/*.*(ts|js|css|scss|json|md)\"",
25-
"pre-commit": "lint-staged",
26-
"commit-msg": "commitlint -E GIT_PARAMS"
29+
"precommit": "lint-staged",
30+
"commitmsg": "commitlint -E GIT_PARAMS"
2731
},
2832
"lint-staged": {
2933
"*.{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)