Skip to content
This repository was archived by the owner on Jun 26, 2023. It is now read-only.

Commit f92b52c

Browse files
authored
chore: use semantic-release-monorepo (#135)
1 parent 10eb3ce commit f92b52c

File tree

9 files changed

+120
-52
lines changed

9 files changed

+120
-52
lines changed

.github/workflows/main.yml

Lines changed: 61 additions & 12 deletions
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,12 +229,12 @@ 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
183-
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && !contains(github.event.head_commit.author.name, 'Github Actions')
237+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
184238
steps:
185239
- uses: actions/checkout@v2.4.0
186240
with:
@@ -206,11 +260,6 @@ jobs:
206260
npm install
207261
npm run --if-present build
208262
- run: |
209-
git config --global user.email "actions@github.com"
210-
git config --global user.name "Github Actions"
211-
if [[ -n "${NPM_TOKEN}" ]]; then
212-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
213-
fi
214263
if [[ -n "${DOCKER_TOKEN}" ]] && [[ -n "${DOCKER_USERNAME}" ]]; then
215264
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
216265
fi

package.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@
55
"private": true,
66
"scripts": {
77
"reset": "lerna run clean && rimraf ./node_modules ./package-lock.json packages/*/node_modules packages/*/package-lock.json packages/*/dist",
8-
"test": "lerna run test -- --",
9-
"test:node": "lerna run test:node -- --",
10-
"test:browser": "lerna run test:browser -- --",
11-
"test:electron-main": "lerna run test:electron-main -- --",
8+
"test": "lerna run --concurrency 1 test -- --",
9+
"test:node": "lerna run --concurrency 1 test:node -- --",
10+
"test:chrome": "lerna run --concurrency 1 test:chrome -- --",
11+
"test:chrome-webworker": "lerna --concurrency 1 run test:chrome-webworker -- --",
12+
"test:firefox": "lerna run --concurrency 1 test:firefox -- --",
13+
"test:firefox-webworker": "lerna run --concurrency 1 test:firefox-webworker -- --",
14+
"test:electron-main": "lerna run --concurrency 1 test:electron-main -- --",
15+
"test:electron-renderer": "lerna run --concurrency 1 test:electron-renderer -- --",
1216
"build": "lerna run build",
1317
"lint": "lerna run lint",
1418
"dep-check": "lerna run dep-check",
15-
"release": "lerna publish --canary --preid rc --dist-tag next --force-publish --yes"
19+
"release": "semantic-release -e semantic-release-monorepo"
1620
},
1721
"bugs": "https://github.com/libp2p/js-libp2p-interfaces/issues",
1822
"homepage": "https://github.com/libp2p/js-libp2p-interfaces#readme",

packages/libp2p-connection/package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@
2424
"scripts": {
2525
"lint": "aegir lint",
2626
"dep-check": "aegir dep-check dist/src/**/*.js",
27-
"pretest": "npm run build",
2827
"build": "tsc",
28+
"pretest": "npm run build",
2929
"test": "aegir test -f ./dist/test/**/*.js",
30-
"test:browser": "aegir test -t browser -f ./dist/test/**/*.js",
31-
"test:node": "aegir test -t node -f ./dist/test/**/*.js",
32-
"test:electron-main": "aegir test -t electron-main -f ./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
},
3437
"repository": {
3538
"type": "git",
@@ -52,7 +55,7 @@
5255
},
5356
"devDependencies": {
5457
"@libp2p/peer-id-factory": "^0.2.0",
55-
"aegir": "^36.0.0"
58+
"aegir": "^36.1.3"
5659
},
5760
"exports": {
5861
".": {

packages/libp2p-interface-compliance-tests/package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@
2525
"build": "tsc",
2626
"pretest": "npm run build",
2727
"test": "aegir test -f ./dist/test/**/*.js",
28-
"test:browser": "aegir test -t browser -f ./dist/test/**/*.js",
29-
"test:node": "aegir test -t node -f ./dist/test/**/*.js",
30-
"test:electron-main": "aegir test -t electron-main -f ./dist/test/**/*.js"
28+
"test:chrome": "npm run test -- -t browser",
29+
"test:chrome-webworker": "npm run test -- -t webworker",
30+
"test:firefox": "npm run test -- -t browser -- --browser firefox",
31+
"test:firefox-webworker": "npm run test -- -t webworker -- --browser firefox",
32+
"test:node": "npm run test -- -t node --cov",
33+
"test:electron-main": "npm run test -- -t electron-main"
3134
},
3235
"repository": {
3336
"type": "git",
@@ -54,7 +57,7 @@
5457
"@multiformats/multiaddr": "^10.1.1",
5558
"abort-controller": "^3.0.0",
5659
"abortable-iterator": "^3.0.0",
57-
"aegir": "^36.0.0",
60+
"aegir": "^36.1.3",
5861
"chai": "^4.3.4",
5962
"chai-checkmark": "^1.0.1",
6063
"delay": "^5.0.0",

packages/libp2p-interfaces/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"multiformats": "^9.4.10"
4343
},
4444
"devDependencies": {
45-
"aegir": "^36.0.0"
45+
"aegir": "^36.1.3"
4646
},
4747
"exports": {
4848
".": {

packages/libp2p-peer-id-factory/package.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,20 @@
3333
]
3434
},
3535
"scripts": {
36+
"lint": "aegir lint",
37+
"dep-check": "aegir dep-check dist/src/**/*.js",
38+
"build": "tsc",
3639
"pretest": "npm run build",
3740
"test": "aegir test -f ./dist/test/**/*.js",
38-
"test:browser": "aegir test -t browser -f ./dist/test/**/*.js",
39-
"test:node": "aegir test -t node -f ./dist/test/**/*.js",
40-
"test:electron-main": "aegir test -t electron-main -f ./dist/test/**/*.js",
41-
"lint": "aegir ts -p check && aegir lint",
42-
"build": "tsc",
41+
"test:chrome": "npm run test -- -t browser",
42+
"test:chrome-webworker": "npm run test -- -t webworker",
43+
"test:firefox": "npm run test -- -t browser -- --browser firefox",
44+
"test:firefox-webworker": "npm run test -- -t webworker -- --browser firefox",
45+
"test:node": "npm run test -- -t node --cov",
46+
"test:electron-main": "npm run test -- -t electron-main",
4347
"build:proto": "npm run build:proto:js && npm run build:proto:types",
4448
"build:proto:js": "pbjs -t static-module -w es6 --es6 -r libp2p-peer-id --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/proto.js ./src/proto.proto",
45-
"build:proto:types": "pbts -o src/proto.d.ts src/proto.js",
46-
"dep-check": "aegir dep-check dist/src/**/*.js dist/test/**/*.js"
49+
"build:proto:types": "pbts -o src/proto.d.ts src/proto.js"
4750
},
4851
"keywords": [
4952
"IPFS"
@@ -61,7 +64,7 @@
6164
},
6265
"homepage": "https://github.com/libp2p/js-libp2p-interfaces/tree/master/packages/libp2p-peer-id-factory#readme",
6366
"devDependencies": {
64-
"aegir": "^36.0.1",
67+
"aegir": "^36.1.3",
6568
"util": "^0.12.3"
6669
},
6770
"dependencies": {

packages/libp2p-peer-id/package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,17 @@
2121
}
2222
},
2323
"scripts": {
24+
"lint": "aegir lint",
25+
"dep-check": "aegir dep-check dist/src/**/*.js",
26+
"build": "tsc",
2427
"pretest": "npm run build",
2528
"test": "aegir test -f ./dist/test/**/*.js",
26-
"test:browser": "aegir test -t browser -f ./dist/test/**/*.js",
27-
"test:node": "aegir test -t node -f ./dist/test/**/*.js",
28-
"test:electron-main": "aegir test -t electron-main -f ./dist/test/**/*.js",
29-
"lint": "aegir ts -p check && aegir lint",
30-
"build": "tsc",
31-
"dep-check": "aegir dep-check dist/src/**/*.js dist/test/**/*.js"
29+
"test:chrome": "npm run test -- -t browser",
30+
"test:chrome-webworker": "npm run test -- -t webworker",
31+
"test:firefox": "npm run test -- -t browser -- --browser firefox",
32+
"test:firefox-webworker": "npm run test -- -t webworker -- --browser firefox",
33+
"test:node": "npm run test -- -t node --cov",
34+
"test:electron-main": "npm run test -- -t electron-main"
3235
},
3336
"keywords": [
3437
"IPFS"
@@ -46,7 +49,7 @@
4649
},
4750
"homepage": "https://github.com/libp2p/js-libp2p-interfaces/tree/master/packages/libp2p-peer-id#readme",
4851
"devDependencies": {
49-
"aegir": "^36.0.1"
52+
"aegir": "^36.1.3"
5053
},
5154
"dependencies": {
5255
"@libp2p/interfaces": "^0.2.0",

packages/libp2p-pubsub/package.json

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,23 @@
2626
"scripts": {
2727
"lint": "aegir lint",
2828
"dep-check": "aegir dep-check dist/src/**/*.js",
29-
"build": "npm run build:types && npm run build:copy-proto-files",
30-
"build:types": "tsc",
29+
"build": "tsc",
30+
"postbuild": "npm run build:copy-proto-files",
31+
"pretest": "npm run build",
32+
"test": "aegir test -f ./dist/test/**/*.js",
33+
"test:chrome": "npm run test -- -t browser",
34+
"test:chrome-webworker": "npm run test -- -t webworker",
35+
"test:firefox": "npm run test -- -t browser -- --browser firefox",
36+
"test:firefox-webworker": "npm run test -- -t webworker -- --browser firefox",
37+
"test:node": "npm run test -- -t node --cov",
38+
"test:electron-main": "npm run test -- -t electron-main",
3139
"build:proto": "npm run build:proto:rpc && npm run build:proto:topic-descriptor",
3240
"build:proto:rpc": "pbjs -t static-module -w es6 -r libp2p-pubsub-rpc --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/message/rpc.js ./src/message/rpc.proto",
3341
"build:proto:topic-descriptor": "pbjs -t static-module -w es6 -r libp2p-pubsub-topic-descriptor --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/message/topic-descriptor.js ./src/message/topic-descriptor.proto",
3442
"build:proto-types": "npm run build:proto-types:rpc && npm run build:proto-types:topic-descriptor",
3543
"build:proto-types:rpc": "pbts -o src/message/rpc.d.ts src/message/rpc.js",
3644
"build:proto-types:topic-descriptor": "pbts -o src/message/topic-descriptor.d.ts src/message/topic-descriptor.js",
37-
"build:copy-proto-files": "cp src/message/*.js dist/src/message && cp src/message/*.d.ts dist/src/message",
38-
"pretest": "npm run build",
39-
"test": "aegir test -f ./dist/test/**/*.js",
40-
"test:browser": "aegir test -t browser -f ./dist/test/**/*.js",
41-
"test:node": "aegir test -t node -f ./dist/test/**/*.js",
42-
"test:electron-main": "aegir test -t electron-main -f ./dist/test/**/*.js"
45+
"build:copy-proto-files": "cp src/message/*.js dist/src/message && cp src/message/*.d.ts dist/src/message"
4346
},
4447
"repository": {
4548
"type": "git",
@@ -74,7 +77,7 @@
7477
"devDependencies": {
7578
"@types/bl": "^5.0.2",
7679
"@types/debug": "^4.1.7",
77-
"aegir": "^36.0.0",
80+
"aegir": "^36.1.3",
7881
"protobufjs": "^6.10.2",
7982
"util": "^0.12.4"
8083
},

packages/libp2p-topology/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"err-code": "^3.0.1"
4444
},
4545
"devDependencies": {
46-
"aegir": "^36.0.0"
46+
"aegir": "^36.1.3"
4747
},
4848
"exports": {
4949
".": {

0 commit comments

Comments
 (0)