-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
873 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
version: 2 | ||
|
||
defaults: | ||
workspace_root: &workspace_root | ||
~/wfs-client | ||
|
||
nodejs_container: &nodejs_container | ||
working_directory: *workspace_root | ||
docker: | ||
- image: circleci/node:8-stretch | ||
|
||
golang_container: &golang_container | ||
working_directory: *workspace_root | ||
docker: | ||
- image: circleci/golang:1-stretch | ||
|
||
filters: &default_filters | ||
tags: | ||
only: '/v[0-9]+(\.[0-9]+)*/' | ||
|
||
attach_workspace: &attach_workspace | ||
attach_workspace: | ||
at: *workspace_root | ||
|
||
restore_node_modules: &restore_node_modules | ||
restore_cache: | ||
name: Restore node_modules cache | ||
keys: | ||
- v1-wfs-client-node-{{ .Branch }}-{{ checksum "yarn.lock" }} | ||
- v1-wfs-client-node-master-{{ checksum "yarn.lock" }} | ||
- v1-wfs-client-node-master- | ||
|
||
jobs: | ||
checkout: | ||
<<: *nodejs_container | ||
steps: | ||
- checkout | ||
|
||
- persist_to_workspace: | ||
root: *workspace_root | ||
paths: | ||
- ./ | ||
|
||
install: | ||
<<: *nodejs_container | ||
steps: | ||
- *attach_workspace | ||
- *restore_node_modules | ||
|
||
- restore_cache: | ||
name: Restore yarn cache | ||
keys: | ||
- v1-wfs-client-yarn-{{ checksum "yarn.lock" }} | ||
- v1-wfs-client-yarn- | ||
|
||
- run: | ||
name: Install dependencies | ||
command: yarn | ||
|
||
- save_cache: | ||
name: Save yarn cache | ||
key: v1-wfs-client-yarn-{{ checksum "yarn.lock" }} | ||
paths: | ||
- ~/.cache/yarn/ | ||
|
||
- save_cache: | ||
name: Save node_modules cache | ||
key: v1-wfs-client-node-{{ .Branch }}-{{ checksum "yarn.lock" }} | ||
paths: | ||
- node_modules/ | ||
|
||
lint: | ||
<<: *nodejs_container | ||
steps: | ||
- *attach_workspace | ||
- *restore_node_modules | ||
|
||
- run: | ||
name: Lint JavaScript | ||
command: yarn xo | ||
|
||
|
||
changelog: | ||
<<: *nodejs_container | ||
steps: | ||
- *attach_workspace | ||
- *restore_node_modules | ||
|
||
- restore_cache: | ||
name: Restore changelog cache | ||
keys: | ||
- v1-wfs-client-changelog-{{ .BuildNum }} | ||
- v1-wfs-client-changelog- | ||
|
||
- run: | ||
name: Generate changelog | ||
command: | | ||
if [ $CIRCLE_TAG ]; then | ||
PREV_TAG=$(git describe --abbrev=0 --tags $CIRCLE_TAG^) | ||
echo "[+] Running for range $PREV_TAG...$CIRCLE_TAG" | ||
node_modules/.bin/lerna-changelog --from $PREV_TAG --to $CIRCLE_TAG > CHANGELOG.md | ||
else | ||
PREV_TAG=$(git describe --abbrev=0 --tags) | ||
echo "[+] Running from $PREV_TAG" | ||
node_modules/.bin/lerna-changelog --from $PREV_TAG > CHANGELOG.md | ||
fi | ||
- save_cache: | ||
name: Save changelog cache | ||
key: v1-wfs-client-changelog-{{ .BuildNum }} | ||
paths: | ||
- .changelog/ | ||
|
||
- run: | ||
name: Display changelog | ||
command: cat CHANGELOG.md | ||
|
||
- persist_to_workspace: | ||
name: Persist changelog | ||
root: *workspace_root | ||
paths: | ||
- CHANGELOG.md | ||
|
||
release: | ||
<<: *golang_container | ||
steps: | ||
- *attach_workspace | ||
- *restore_node_modules | ||
|
||
- run: | ||
name: Install github-release | ||
command: go get github.com/aktau/github-release | ||
|
||
- run: | ||
name: Create GitHub release | ||
command: github-release release --user $CIRCLE_PROJECT_USERNAME --repo $CIRCLE_PROJECT_REPONAME --tag $CIRCLE_TAG --description "$(cat CHANGELOG.md)" --name $CIRCLE_TAG | ||
|
||
workflows: | ||
version: 2 | ||
|
||
push: | ||
jobs: | ||
- checkout: | ||
filters: *default_filters | ||
|
||
- install: | ||
requires: | ||
- checkout | ||
filters: *default_filters | ||
|
||
- lint: | ||
requires: | ||
- install | ||
filters: *default_filters | ||
|
||
- changelog: | ||
requires: | ||
- install | ||
filters: *default_filters | ||
|
||
- release: | ||
requires: | ||
- changelog | ||
filters: | ||
<<: *default_filters | ||
branches: | ||
ignore: /.*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,15 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
CHANGELOG.md | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
# Cache | ||
.yarn-cache | ||
.changelog | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
# Node | ||
node_modules | ||
|
||
# Coverage directory used by tools like istanbul | ||
# Reports | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directory | ||
# Deployed apps should consider commenting this line out: | ||
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git | ||
node_modules | ||
reports |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.