diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2b622f0d..46b961a5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: @@ -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 @@ -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 @@ -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 @@ -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: @@ -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 }} diff --git a/LICENSE b/LICENSE index 8294e7ea..b0b237fa 100644 --- a/LICENSE +++ b/LICENSE @@ -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 \ No newline at end of file diff --git a/LICENSE-APACHE b/LICENSE-APACHE new file mode 100644 index 00000000..14478a3b --- /dev/null +++ b/LICENSE-APACHE @@ -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. diff --git a/LICENSE-MIT b/LICENSE-MIT new file mode 100644 index 00000000..749aa1ec --- /dev/null +++ b/LICENSE-MIT @@ -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. \ No newline at end of file diff --git a/package.json b/package.json index 28767645..67a22f73 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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",