Skip to content

Commit

Permalink
Merge pull request #86 from vansergen/dependencies
Browse files Browse the repository at this point in the history
Dependencies
  • Loading branch information
vansergen committed Dec 20, 2020
2 parents fe44f0a + bf0c9d5 commit abf4683
Show file tree
Hide file tree
Showing 35 changed files with 9,307 additions and 6,654 deletions.
64 changes: 0 additions & 64 deletions .circleci/config.yml

This file was deleted.

1 change: 1 addition & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "extends": "b2broker" }
11 changes: 11 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Typescript compiled files
build/

# Documentation
docs/

# nyc test coverage
.nyc_output/

# Coverage directory used by nyc
coverage/
49 changes: 1 addition & 48 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,48 +1 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"overrides": [
{
"files": ["*.js"],
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-var-requires": "off"
}
},
{
"files": ["*.d.ts"],
"rules": {
"@typescript-eslint/no-explicit-any": "off"
}
},
{
"files": ["./build/index.js"],
"rules": {
"no-prototype-builtins": "off"
}
}
],
"env": {
"node": true,
"es2020": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {
"curly": "error",
"eqeqeq": "error",
"linebreak-style": "error",
"no-console": "error",
"quotes": "error",
"prefer-destructuring": "error",
"semi": "error",
"@typescript-eslint/camelcase": "off"
}
}
{ "extends": ["b2broker-ts"], "parserOptions": { "project": "tsconfig.json" } }
Binary file added .github/pgp/key.asc.gpg
Binary file not shown.
5 changes: 5 additions & 0 deletions .github/scripts/cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -e

# Delete the private key
rm -f .github/pgp/key.asc
12 changes: 12 additions & 0 deletions .github/scripts/decrypt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -e

# Descrypt the private key
gpg --quiet --batch --yes --decrypt --passphrase=${PRIVATE_KEY_PASSPHRASE} \
--output ./.github/pgp/key.asc ./.github/pgp/key.asc.gpg

# Set the access permissions
chmod 600 ./.github/pgp/key.asc

# Import the private key
gpg --batch --yes --import ./.github/pgp/key.asc
7 changes: 7 additions & 0 deletions .github/scripts/encrypt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -e

# Encrypt PGP key
gpg --batch --symmetric --cipher-algo AES256 \
--output ./.github/pgp/key.asc.gpg --passphrase=${PRIVATE_KEY_PASSPHRASE} \
./.github/pgp/key.asc
11 changes: 11 additions & 0 deletions .github/scripts/git.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -e

# Set pgp siging key
git config user.signingkey ${PGP_KEY_ID}

# Set the custom gpg program (that passes the passphrase to `gpg`)
git config gpg.program ./.github/scripts/gpg.sh

# Sign commits with PGP key
git config commit.gpgsign true
5 changes: 5 additions & 0 deletions .github/scripts/gpg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -e

# Pass the passphrase to gpg
gpg --batch --pinentry-mode=loopback --passphrase ${PGP_PASSPHRASE} -v $@
130 changes: 130 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
name: CI

on: [push]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14, 15]

container: node:${{ matrix.node-version }}-buster

steps:
- uses: actions/checkout@master
with:
fetch-depth: 0

- name: Node.js version
run: node --version

- name: npm version
run: npm --version

- name: Git version
run: git --version

- name: Install dependencies
run: npm ci

- name: Tests
run: npm test

- name: Tests:js
run: npm run test:js

- name: Prettier
run: npm run prettier

- name: commitlint
run: npm run commitlint:all

- name: ESLint
run: npm run lint

- name: Publish test
run: npm run publish:test

- name: Docs
run: |
rm -rf docs
npm run docs:test
- name: npm vulnerabilities
run: npm audit --production

coverage:
runs-on: ubuntu-latest

container: node:14

steps:
- uses: actions/checkout@master

- name: Node.js version
run: node --version

- name: npm version
run: npm --version

- name: Install dependencies
run: npm ci

- name: Coverage
run: npm run coverage

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

release:
needs: [test, coverage]

runs-on: ubuntu-latest

container: node:14-buster

steps:
- uses: actions/checkout@master
with:
fetch-depth: 0

- name: Node.js version
run: node --version

- name: npm version
run: npm --version

- name: git version
run: git --version

- name: gpg version
run: gpg --version

- name: Install dependencies
run: npm ci

- name: Decrypt PGP key
run: ./.github/scripts/decrypt.sh

- name: Setup git
run: ./.github/scripts/git.sh

- name: Release
run: npm run release

- name: Cleanup
run: ./.github/scripts/cleanup.sh

env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
NPM_CONFIG_UNSAFE_PERM: true
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PGP_KEY_ID: ${{ secrets.PGP_KEY_ID }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PRIVATE_KEY_PASSPHRASE: ${{ secrets.PRIVATE_KEY_PASSPHRASE }}
25 changes: 0 additions & 25 deletions .github/workflows/publish.yml

This file was deleted.

Loading

0 comments on commit abf4683

Please sign in to comment.