Skip to content

Commit

Permalink
chore: Update tooling
Browse files Browse the repository at this point in the history
- Move CI/CD to GitHub Actions
- Use semantic-release for deployment
- Update dependencies
- Use Dependabot to track dependencies updates

BREAKING CHANGE: none, releasing v1 to follow SemVer
(now enforced by semantic-release).
  • Loading branch information
franky47 committed May 14, 2020
1 parent 172cb02 commit a40e2d4
Show file tree
Hide file tree
Showing 10 changed files with 1,393 additions and 1,024 deletions.
26 changes: 26 additions & 0 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: 1
update_configs:
# Dependencies
- package_manager: javascript
directory: /
update_schedule: live
default_assignees:
- franky47
automerged_updates:
- match:
dependency_type: development
update_type: all
- match:
dependency_type: production
update_type: in_range
- match:
dependency_type: production
update_type: security:patch
# GitHub Actions
- package_manager: github_actions
directory: /
update_schedule: weekly
default_reviewers:
- franky47
default_assignees:
- franky47
39 changes: 39 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Continuous Delivery

on:
push:
branches:
- master

jobs:
cd:
name: Continuous Delivery
runs-on: ubuntu-latest
steps:
- id: yarn-cache
name: Get Yarn cache path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/checkout@722adc6
- uses: actions/setup-node@1c5c137
with:
node-version: 12.x
- uses: actions/cache@70655ec
name: Load Yarn cache
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --ignore-scripts
name: Install dependencies
- run: yarn build
name: Build package

# Continuous Delivery Pipeline --

- uses: codfish/semantic-release-action@a313b22
name: Semantic Release
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Continuous Integration

on:
push:
branches:
- next
- feature/*
- dependabot/*
pull_request:
types: [opened, edited, reopened]

jobs:
ci:
name: Continuous Integration
runs-on: ubuntu-latest
steps:
- id: yarn-cache
name: Get Yarn cache path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/checkout@722adc6
- uses: actions/setup-node@1c5c137
with:
node-version: 12.x
- uses: actions/cache@70655ec
name: Load Yarn cache
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --ignore-scripts
name: Install dependencies
- run: yarn ci
name: Run integration tests
- uses: coverallsapp/github-action@832e70b
name: Report code coverage
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: 8398a7/action-slack@78391c2
name: Notify on Slack
if: always() # Pick up events even if the job fails or is canceled.
with:
status: ${{ job.status }}
author_name: Continuous Integration
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ dist/
.env
yarn-error.log
.cache

# Docker containers with persistance
.volumes/
coverage/
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ nodemon.json
.env
.volumes/
yarn-error.log
coverage/
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# `cloak`

[![NPM](https://img.shields.io/npm/v/@47ng/cloak?color=red)](https://www.npmjs.com/package/@47ng/cloak)
[![MIT License](https://img.shields.io/github/license/47ng/cloak.svg?color=blue)](https://github.com/47ng/cloak/blob/master/LICENSE)
[![Travis CI Build](https://img.shields.io/travis/com/47ng/cloak.svg)](https://travis-ci.com/47ng/cloak)
[![MIT License](https://img.shields.io/github/license/47ng/cloak.svg?color=blue)](https://github.com/47ng/cloak/blob/next/LICENSE)
[![Continuous Integration](https://github.com/47ng/cloak/workflows/Continuous%20Integration/badge.svg?branch=next)](https://github.com/47ng/cloak/actions)
[![Coverage Status](https://coveralls.io/repos/github/47ng/cloak/badge.svg?branch=next)](https://coveralls.io/github/47ng/cloak?branch=next)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=47ng/cloak)](https://dependabot.com)
[![Average issue resolution time](https://isitmaintained.com/badge/resolution/47ng/cloak.svg)](https://isitmaintained.com/project/47ng/cloak)
[![Number of open issues](https://isitmaintained.com/badge/open/47ng/cloak.svg)](https://isitmaintained.com/project/47ng/cloak)

Serialized AES-GCM 256 encryption, decryption and key management in the browser & Node.js.

Expand Down
7 changes: 0 additions & 7 deletions nodemon.json

This file was deleted.

76 changes: 60 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@47ng/cloak",
"version": "0.15.1",
"version": "0.0.0-semantically-released",
"description": "Serialized AES-GCM 256 encryption, decryption and key management in the browser & Node.js",
"main": "dist/index.js",
"bin": {
Expand All @@ -24,40 +24,41 @@
"access": "public"
},
"scripts": {
"test": "jest --verbose",
"test:watch": "jest --verbose --watch",
"test": "jest --coverage",
"test:watch": "jest --watch",
"test:browser": "parcel ./test/index.html",
"dev": "nodemon -e ts,.env -w .env -w . -x 'run-s build:ts test'",
"link:cli": "chmod +x ./dist/cli.js && ln -s $(pwd)/dist/cli.js ./node_modules/.bin/cloak",
"build:clean": "rm -rf ./dist && rm -f ./node_modules/.bin/cloak",
"build:ts": "tsc",
"build": "run-s build:clean build:ts",
"ci": "run-s test build"
"ci": "run-s build test"
},
"dependencies": {
"@47ng/codec": "^1.0.0",
"@stablelib/base64": "^1.0.0",
"@stablelib/hex": "^1.0.0",
"@stablelib/utf8": "^1.0.0",
"chalk": "^4.0.0",
"commander": "^5.0.0",
"commander": "^5.1.0",
"dotenv": "^8.2.0",
"s-ago": "^2.1.0"
},
"devDependencies": {
"@types/jest": "^25.1.1",
"@types/node": "^13.1.8",
"husky": "^4.0.10",
"jest": "^25.1.0",
"jest-extended": "^0.11.2",
"nodemon": "^2.0.2",
"@commitlint/config-conventional": "^8.3.4",
"@types/jest": "^25.2.2",
"@types/node": "^14.0.1",
"commitlint": "^8.3.5",
"husky": "^4.2.5",
"jest": "^26.0.1",
"jest-extended": "^0.11.5",
"npm-run-all": "^4.1.5",
"parcel-bundler": "^1.12.4",
"ts-jest": "^25.2.0",
"ts-node": "^8.6.2",
"typescript": "^3.7.5"
"ts-jest": "^25.5.1",
"ts-node": "^8.10.1",
"typescript": "^3.9.2"
},
"jest": {
"verbose": true,
"preset": "ts-jest/presets/js-with-ts",
"roots": [
"<rootDir>/src"
Expand All @@ -67,9 +68,52 @@
],
"testEnvironment": "node"
},
"prettier": {
"arrowParens": "avoid",
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "none",
"useTabs": false
},
"husky": {
"hooks": {
"pre-push": "yarn ci"
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
],
"rules": {
"type-enum": [
2,
"always",
[
"build",
"chore",
"ci",
"clean",
"doc",
"feat",
"fix",
"perf",
"ref",
"revert",
"style",
"test"
]
],
"subject-case": [
0,
"always",
"sentence-case"
],
"body-leading-blank": [
2,
"always",
true
]
}
}
}
Loading

0 comments on commit a40e2d4

Please sign in to comment.