Skip to content

Commit

Permalink
Merge pull request decentralized-identity#40 from decentralized-ident…
Browse files Browse the repository at this point in the history
…ity/fix/build-automation

ci: update ci configs
  • Loading branch information
mirceanis authored Nov 4, 2019
2 parents cea9dfc + f7b02e5 commit 38cbc84
Show file tree
Hide file tree
Showing 8 changed files with 13,766 additions and 6,864 deletions.
146 changes: 118 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,127 @@
version: 2
###############################################################
# References
###############################################################
version: 2.1
references:
restore-npm-cache: &restore-npm-cache
restore_cache:
keys:
# when lock file changes, use increasingly general patterns to restore cache
- npm-packages-v1-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}
- npm-packages-v1-{{ checksum "package.json" }}
- npm-packages-v1-

save-npm-cache: &save-npm-cache
save_cache:
paths:
- node_modules/
key: npm-packages-v1-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}

###############################################################
# Workflows
###############################################################
workflows:
# Trigger workflow for last commit (merge commits) to master
# Run unit tests for sanity and if all looks good run semantic release
# Semantic release will decide based on commit messages if another release is needed
# Always run unit tests on master
automatic-semantic-release:
jobs:
- verify-unit-tests:
filters:
branches:
only:
- master
- run-semantic-release:
requires:
- verify-unit-tests
filters:
branches:
only:
- master
tags:
# Would be good if we can ignore tagged commits but it won't trigger another build so it's fine
ignore: /.*/

# This gets triggers on every push to all branches except master
# It verifies the branch, runs unit tests and coverage
verify-test-build:
jobs:
- verify-unit-tests:
filters:
branches:
ignore:
- master

deploy-release-tag:
jobs:
- verify-unit-tests:
filters:
tags:
only: /^v?((\d+\.))?(\d+\.)(\d+)-(dev|alpha|beta).*/
branches:
ignore: /.*/
- deploy-to-npm:
requires:
- verify-unit-tests
filters:
tags:
only: /^v?((\d+\.))?(\d+\.)(\d+)-(dev|alpha|beta).*/
branches:
ignore: /.*/

###############################################################
# Jobs
###############################################################

jobs:
build:
working_directory: ~/repo
verify-unit-tests:
working_directory: ~/project
docker:
- image: circleci/node:8
- image: circleci/node:10
steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- dependencies-cache-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}

- *restore-npm-cache
- run:
name: install-dependencies
command: |
sudo npm i -g codecov node-gyp
npm install
name: Install node modules
command: npm install
- *save-npm-cache
- run:
name: test
command: npm run test && codecov

name: Run unit tests
command: npm run test-with-coverage
- run:
name: code-coverage
command: bash <(curl -s https://codecov.io/bash)

- save_cache:
key: dependency-cache-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}
name: Run lint
command: npm run lint
- persist_to_workspace:
root: ~/project
paths:
- ./node_modules
- node_modules

workflows:
version: 2
build-and-test:
jobs:
- build
run-semantic-release:
working_directory: ~/project
docker:
- image: circleci/node:10
steps:
- checkout:
path: ~/project
- attach_workspace:
at: ~/project
- run:
name: Semantic release
command: |
git config user.email "devops@uport.me"
git config user.name "uport-automation-bot"
npm run release
deploy-to-npm:
working_directory: ~/project
docker:
- image: circleci/node:10
steps:
- checkout:
path: ~/project
- attach_workspace:
at: ~/project
- run:
name: publish to npm
command: npm publish
9 changes: 9 additions & 0 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 1
update_configs:

- package_manager: "javascript"
directory: "/"
update_schedule: "live"
commit_message:
prefix: "chore"
include_scope: true
17 changes: 17 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 30
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: inactive-autoclose
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
14 changes: 14 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"tagFormat": "${version}",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/changelog", {
"changelogFile": "CHANGELOG.md"
}],
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/github"
],
"branch": "master"
}
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ source: "https://github.com/decentralized-identity/ethr-did-resolver/blob/develo

# ethr DID Resolver

[![codecov](https://codecov.io/gh/decentralized-identity/ethr-did-resolver/branch/develop/graph/badge.svg)](https://codecov.io/gh/decentralized-identity/ethr-did-resolver)
[![CircleCI](https://circleci.com/gh/decentralized-identity/ethr-did-resolver.svg?style=svg)](https://circleci.com/gh/decentralized-identity/ethr-did-resolver)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/7bcde296af8e467787b04c956c2c9f6f)](https://www.codacy.com/manual/uport-project/ethr-did-resolver?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=uport-project/ethr-did-resolver&amp;utm_campaign=Badge_Grade)


This library is intended to use ethereum addresses as fully self managed [Decentralized Identifiers](https://w3c-ccg.github.io/did-spec/#decentralized-identifiers-dids) and wrap them in a [DID Document](https://w3c-ccg.github.io/did-spec/#did-documents)

It supports the proposed [Decentralized Identifiers](https://w3c-ccg.github.io/did-spec/) spec from the [W3C Credentials Community Group](https://w3c-ccg.github.io).
Expand Down
2 changes: 1 addition & 1 deletion babel-preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ module.exports = {
}
]
]
};
}
Loading

0 comments on commit 38cbc84

Please sign in to comment.