Skip to content

chore(release): setup auto-release for canary and stable #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 47 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ repo_cache: &repo_cache
deps_cache: &deps_cache
key: v1-dependencies-{{ checksum "yarn.lock" }}

build_cache: &build_cache
key: v1-build-{{ .Environment.CIRCLE_SHA1 }}

version: 2
jobs:
checkout_code:
Expand Down Expand Up @@ -65,10 +68,35 @@ jobs:
- restore_cache: *repo_cache
- restore_cache: *deps_cache
- run: yarn build
- save_cache:
paths:
- packages/example-app/dist
- packages/form/dist
- packages/router/dist
- packages/store/dist
<<: *build_cache

release_canary:
<<: *defaults
steps:
- restore_cache: *repo_cache
- restore_cache: *deps_cache
- restore_cache: *build_cache
# Add --yes flag once verified
- run: yarn release:canary

release_stable:
<<: *defaults
steps:
- restore_cache: *repo_cache
- restore_cache: *deps_cache
- restore_cache: *build_cache
# Add --yes flag once verified
- run: yarn release:stable:ci

workflows:
version: 2
build:
build_and_deploy:
jobs:
- checkout_code
- install_dependencies:
Expand All @@ -83,3 +111,21 @@ workflows:
- build:
requires:
- install_dependencies
- release_canary:
requires:
- lint
- test
- build
filters:
branches:
only: master
- release_stable:
requires:
- lint
- test
- build
filters:
branches:
only: master
tags:
only: /^v.*/
14 changes: 12 additions & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
{
"lerna": "2.11.0",
"packages": ["packages/*"],
"version": "0.0.0",
"version": "9.0.0",
"npmClient": "yarn",
"useWorkspaces": true,
"ignore": "example-app",
"ignoreChanges": ["**/*.spec.ts", "**/*.md"],
"command": {
"init": {
"exact": true
},
"publish": {
"npmClient": "yarn",
"allowBranch": "master",
"message": "chore(release): publish %s"
},
"version": {
"conventionalCommits": true,
"signGitCommit": true,
"signGitTag": true
}
}
}
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "platform",
"private": true,
"workspaces": [
"packages/*"
Expand All @@ -8,12 +9,15 @@
"build:store": "ng-packagr -p packages/store",
"build:form": "ng-packagr -p packages/form",
"build:router": "ng-packagr -p packages/router",
"release:canary": "lerna publish --canary --npm-tag next",
"release:stable": "lerna version",
"release:stable:ci": "lerna publish from-git",
"clean": "npm-run-all -p clean:*",
"clean:deps": "npm-run-all -p clean:deps:*",
"clean:deps:workspace": "rimraf node_modules",
"clean:deps:packages": "rimraf packages/*/node_modules",
"clean:coverage": "rimraf coverage",
"clean:package-dist": "rimraf packages/*/dist",
"clean:dist": "rimraf packages/*/dist",
"lint": "npm-run-all -p lint:*",
"lint:packages": "tslint -p tsconfig.json",
"lint:prettier": "prettier -l \"**/*.*(ts|js|css|scss|json|md)\"",
Expand Down Expand Up @@ -53,7 +57,7 @@
"jest-junit": "5.1.0",
"jest-preset-angular": "6.0.0",
"jest-zone-patch": "0.0.8",
"lerna": "2.11.0",
"lerna": "3.4.3",
"lint-staged": "7.2.0",
"ng-packagr": "3.0.6",
"npm-run-all": "4.1.3",
Expand Down
Loading