Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Commit

Permalink
chore: update build (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain authored Jan 5, 2022
1 parent cecad66 commit 1642c1b
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 37 deletions.
72 changes: 65 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
run: |
npm install
npm run --if-present build
- run: npm run --if-present test:node -- --bail --cov
- run: npm run --if-present test:node
- uses: codecov/codecov-action@v1

test-chrome:
Expand Down Expand Up @@ -94,7 +94,34 @@ jobs:
run: |
npm install
npm run --if-present build
- run: npm run --if-present test:browser -- -t browser -t webworker --bail
- run: npm run --if-present test:chrome

test-chrome-webworker:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
~/.npm
./dist
./node_modules
./packages/*/dist
./packages/*/node_modules
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run --if-present build
- run: npm run --if-present test:chrome-webworker

test-firefox:
needs: check
Expand All @@ -121,7 +148,34 @@ jobs:
run: |
npm install
npm run --if-present build
- run: npm run --if-present test:browser -- -t browser -t webworker --bail -- --browser firefox
- run: npm run --if-present test:firefox

test-firefox-webworker:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
~/.npm
./dist
./node_modules
./packages/*/dist
./packages/*/node_modules
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run --if-present build
- run: npm run --if-present test:firefox-webworker

test-electron-main:
needs: check
Expand All @@ -148,7 +202,7 @@ jobs:
run: |
npm install
npm run --if-present build
- run: npx xvfb-maybe npm run --if-present test:electron-main --bail
- run: npx xvfb-maybe npm run --if-present test:electron-main

test-electron-renderer:
needs: check
Expand All @@ -175,10 +229,10 @@ jobs:
run: |
npm install
npm run --if-present build
- run: npx xvfb-maybe npm run --if-present test:electron-renderer --bail
- run: npx xvfb-maybe npm run --if-present test:electron-renderer

release:
needs: [test-node, test-chrome, test-firefox, test-electron-main]
needs: [test-node, test-chrome, test-chrome-webworker, test-firefox, test-firefox-webworker, test-electron-main, test-electron-renderer]
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
Expand All @@ -205,7 +259,11 @@ jobs:
run: |
npm install
npm run --if-present build
- run: npm run --if-present release
- run: |
if [[ -n "${DOCKER_TOKEN}" ]] && [[ -n "${DOCKER_USERNAME}" ]]; then
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
fi
npm run --if-present release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
23 changes: 2 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,2 @@
The MIT License (MIT)

Copyright (c) 2016 Friedel Ziegelmayer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
MIT: https://www.opensource.org/licenses/mit
Apache-2.0: https://www.apache.org/licenses/license-2.0
5 changes: 5 additions & 0 deletions LICENSE-APACHE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
19 changes: 19 additions & 0 deletions LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
21 changes: 12 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,21 @@
]
},
"scripts": {
"lint": "aegir lint",
"dep-check": "aegir dep-check dist/src/**/*.js dist/test/**/*.js",
"build": "tsc",
"pretest": "npm run build",
"test": "aegir test -f ./dist/test/**/*.js",
"test:browser": "aegir test -t browser -f ./dist/test/**/*.js",
"test:node": "aegir test -t node -f ./dist/test/**/*.js",
"test:electron-main": "aegir test -t electron-main -f ./dist/test/**/*.js",
"lint": "aegir ts -p check && aegir lint",
"build": "tsc",
"test:chrome": "npm run test -- -t browser",
"test:chrome-webworker": "npm run test -- -t webworker",
"test:firefox": "npm run test -- -t browser -- --browser firefox",
"test:firefox-webworker": "npm run test -- -t webworker -- --browser firefox",
"test:node": "npm run test -- -t node --cov",
"test:electron-main": "npm run test -- -t electron-main",
"release": "semantic-release",
"build:proto": "npm run build:proto:js && npm run build:proto:types",
"build:proto:js": "pbjs -t static-module -w es6 --es6 -r libp2p-crypto-keys --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/keys/keys.js ./src/keys/keys.proto",
"build:proto:types": "pbts -o src/keys/keys.d.ts src/keys/keys.js",
"dep-check": "aegir dep-check dist/src/**/*.js dist/test/**/*.js",
"release": "semantic-release"
"build:proto:types": "pbts -o src/keys/keys.d.ts src/keys/keys.js"
},
"browser": {
"./dist/src/aes/ciphers.js": "./dist/src/aes/ciphers-browser.js",
Expand All @@ -64,7 +67,7 @@
"rsa",
"secp256k1"
],
"license": "MIT",
"license": "(Apache-2.0 OR MIT)",
"dependencies": {
"@noble/ed25519": "^1.3.3",
"@noble/secp256k1": "^1.3.4",
Expand Down

0 comments on commit 1642c1b

Please sign in to comment.