Skip to content

Commit c04f330

Browse files
authored
chore: update build (#218)
1 parent 0ec3e27 commit c04f330

File tree

5 files changed

+102
-36
lines changed

5 files changed

+102
-36
lines changed

.github/workflows/main.yml

+65-7
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
run: |
6767
npm install
6868
npm run --if-present build
69-
- run: npm run --if-present test:node -- --bail --cov
69+
- run: npm run --if-present test:node
7070
- uses: codecov/codecov-action@v1
7171

7272
test-chrome:
@@ -94,7 +94,34 @@ jobs:
9494
run: |
9595
npm install
9696
npm run --if-present build
97-
- run: npm run --if-present test:browser -- -t browser -t webworker --bail
97+
- run: npm run --if-present test:chrome
98+
99+
test-chrome-webworker:
100+
needs: check
101+
runs-on: ubuntu-latest
102+
steps:
103+
- uses: actions/checkout@v2
104+
- uses: actions/setup-node@v2
105+
with:
106+
node-version: lts/*
107+
- uses: actions/cache@v2
108+
id: cache
109+
env:
110+
CACHE_NAME: cache-node-modules
111+
with:
112+
path: |
113+
~/.npm
114+
./dist
115+
./node_modules
116+
./packages/*/dist
117+
./packages/*/node_modules
118+
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }}
119+
- name: Install Dependencies
120+
if: steps.cache.outputs.cache-hit != 'true'
121+
run: |
122+
npm install
123+
npm run --if-present build
124+
- run: npm run --if-present test:chrome-webworker
98125

99126
test-firefox:
100127
needs: check
@@ -121,7 +148,34 @@ jobs:
121148
run: |
122149
npm install
123150
npm run --if-present build
124-
- run: npm run --if-present test:browser -- -t browser -t webworker --bail -- --browser firefox
151+
- run: npm run --if-present test:firefox
152+
153+
test-firefox-webworker:
154+
needs: check
155+
runs-on: ubuntu-latest
156+
steps:
157+
- uses: actions/checkout@v2
158+
- uses: actions/setup-node@v2
159+
with:
160+
node-version: lts/*
161+
- uses: actions/cache@v2
162+
id: cache
163+
env:
164+
CACHE_NAME: cache-node-modules
165+
with:
166+
path: |
167+
~/.npm
168+
./dist
169+
./node_modules
170+
./packages/*/dist
171+
./packages/*/node_modules
172+
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }}
173+
- name: Install Dependencies
174+
if: steps.cache.outputs.cache-hit != 'true'
175+
run: |
176+
npm install
177+
npm run --if-present build
178+
- run: npm run --if-present test:firefox-webworker
125179

126180
test-electron-main:
127181
needs: check
@@ -148,7 +202,7 @@ jobs:
148202
run: |
149203
npm install
150204
npm run --if-present build
151-
- run: npx xvfb-maybe npm run --if-present test:electron-main --bail
205+
- run: npx xvfb-maybe npm run --if-present test:electron-main
152206

153207
test-electron-renderer:
154208
needs: check
@@ -175,10 +229,10 @@ jobs:
175229
run: |
176230
npm install
177231
npm run --if-present build
178-
- run: npx xvfb-maybe npm run --if-present test:electron-renderer --bail
232+
- run: npx xvfb-maybe npm run --if-present test:electron-renderer
179233

180234
release:
181-
needs: [test-node, test-chrome, test-firefox, test-electron-main]
235+
needs: [test-node, test-chrome, test-chrome-webworker, test-firefox, test-firefox-webworker, test-electron-main, test-electron-renderer]
182236
runs-on: ubuntu-latest
183237
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
184238
steps:
@@ -205,7 +259,11 @@ jobs:
205259
run: |
206260
npm install
207261
npm run --if-present build
208-
- run: npm run --if-present release
262+
- run: |
263+
if [[ -n "${DOCKER_TOKEN}" ]] && [[ -n "${DOCKER_USERNAME}" ]]; then
264+
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
265+
fi
266+
npm run --if-present release
209267
env:
210268
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
211269
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

LICENSE

+2-21
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,2 @@
1-
The MIT License (MIT)
2-
3-
Copyright (c) 2016 Protocol Labs Inc.
4-
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
11-
12-
The above copyright notice and this permission notice shall be included in
13-
all copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
THE SOFTWARE.
1+
MIT: https://www.opensource.org/licenses/mit
2+
Apache-2.0: https://www.apache.org/licenses/license-2.0

LICENSE-APACHE

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
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
2+
3+
http://www.apache.org/licenses/LICENSE-2.0
4+
5+
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.

LICENSE-MIT

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
The MIT License (MIT)
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

package.json

+11-8
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@
2222
}
2323
},
2424
"scripts": {
25+
"lint": "aegir lint",
26+
"dep-check": "aegir dep-check dist/src/**/*.js dist/test/**/*.js",
27+
"build": "tsc",
2528
"pretest": "npm run build",
2629
"test": "aegir test -f ./dist/test/**/*.js",
27-
"test:browser": "aegir test -t browser -f ./dist/test/**/*.js",
28-
"test:node": "aegir test -t node -f ./dist/test/**/*.js",
29-
"test:electron-main": "aegir test -t electron-main -f ./dist/test/**/*.js",
30-
"lint": "aegir ts -p check && aegir lint",
31-
"build": "tsc",
32-
"dep-check": "aegir dep-check dist/src/**/*.js dist/test/**/*.js",
30+
"test:chrome": "npm run test -- -t browser",
31+
"test:chrome-webworker": "npm run test -- -t webworker",
32+
"test:firefox": "npm run test -- -t browser -- --browser firefox",
33+
"test:firefox-webworker": "npm run test -- -t webworker -- --browser firefox",
34+
"test:node": "npm run test -- -t node --cov",
35+
"test:electron-main": "npm run test -- -t electron-main",
3336
"release": "semantic-release"
3437
},
3538
"browser": {
@@ -41,7 +44,7 @@
4144
"binary",
4245
"string"
4346
],
44-
"license": "MIT",
47+
"license": "(Apache-2.0 OR MIT)",
4548
"bugs": "https://github.com/multiformats/js-multiaddr/issues",
4649
"homepage": "https://github.com/multiformats/js-multiaddr",
4750
"dependencies": {
@@ -54,7 +57,7 @@
5457
},
5558
"devDependencies": {
5659
"@types/varint": "^6.0.0",
57-
"aegir": "^36.1.2",
60+
"aegir": "^36.1.3",
5861
"sinon": "^12.0.1",
5962
"util": "^0.12.3"
6063
}

0 commit comments

Comments
 (0)