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

chore: use semantic-release-monorepo #135

Merged
merged 2 commits into from
Jan 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 61 additions & 12 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,12 +229,12 @@ 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' && !contains(github.event.head_commit.author.name, 'Github Actions')
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2.4.0
with:
Expand All @@ -206,11 +260,6 @@ jobs:
npm install
npm run --if-present build
- run: |
git config --global user.email "actions@github.com"
git config --global user.name "Github Actions"
if [[ -n "${NPM_TOKEN}" ]]; then
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
fi
if [[ -n "${DOCKER_TOKEN}" ]] && [[ -n "${DOCKER_USERNAME}" ]]; then
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
fi
Expand Down
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@
"private": true,
"scripts": {
"reset": "lerna run clean && rimraf ./node_modules ./package-lock.json packages/*/node_modules packages/*/package-lock.json packages/*/dist",
"test": "lerna run test -- --",
"test:node": "lerna run test:node -- --",
"test:browser": "lerna run test:browser -- --",
"test:electron-main": "lerna run test:electron-main -- --",
"test": "lerna run --concurrency 1 test -- --",
"test:node": "lerna run --concurrency 1 test:node -- --",
"test:chrome": "lerna run --concurrency 1 test:chrome -- --",
"test:chrome-webworker": "lerna --concurrency 1 run test:chrome-webworker -- --",
"test:firefox": "lerna run --concurrency 1 test:firefox -- --",
"test:firefox-webworker": "lerna run --concurrency 1 test:firefox-webworker -- --",
"test:electron-main": "lerna run --concurrency 1 test:electron-main -- --",
"test:electron-renderer": "lerna run --concurrency 1 test:electron-renderer -- --",
"build": "lerna run build",
"lint": "lerna run lint",
"dep-check": "lerna run dep-check",
"release": "lerna publish --canary --preid rc --dist-tag next --force-publish --yes"
"release": "semantic-release -e semantic-release-monorepo"
},
"bugs": "https://github.com/libp2p/js-libp2p-interfaces/issues",
"homepage": "https://github.com/libp2p/js-libp2p-interfaces#readme",
Expand Down
13 changes: 8 additions & 5 deletions packages/libp2p-connection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@
"scripts": {
"lint": "aegir lint",
"dep-check": "aegir dep-check dist/src/**/*.js",
"pretest": "npm run build",
"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"
"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"
},
"repository": {
"type": "git",
Expand All @@ -52,7 +55,7 @@
},
"devDependencies": {
"@libp2p/peer-id-factory": "^0.2.0",
"aegir": "^36.0.0"
"aegir": "^36.1.3"
},
"exports": {
".": {
Expand Down
11 changes: 7 additions & 4 deletions packages/libp2p-interface-compliance-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@
"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"
"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"
},
"repository": {
"type": "git",
Expand All @@ -54,7 +57,7 @@
"@multiformats/multiaddr": "^10.1.1",
"abort-controller": "^3.0.0",
"abortable-iterator": "^3.0.0",
"aegir": "^36.0.0",
"aegir": "^36.1.3",
"chai": "^4.3.4",
"chai-checkmark": "^1.0.1",
"delay": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/libp2p-interfaces/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"multiformats": "^9.4.10"
},
"devDependencies": {
"aegir": "^36.0.0"
"aegir": "^36.1.3"
},
"exports": {
".": {
Expand Down
19 changes: 11 additions & 8 deletions packages/libp2p-peer-id-factory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,20 @@
]
},
"scripts": {
"lint": "aegir lint",
"dep-check": "aegir dep-check dist/src/**/*.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",
"build:proto": "npm run build:proto:js && npm run build:proto:types",
"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",
"build:proto:types": "pbts -o src/proto.d.ts src/proto.js",
"dep-check": "aegir dep-check dist/src/**/*.js dist/test/**/*.js"
"build:proto:types": "pbts -o src/proto.d.ts src/proto.js"
},
"keywords": [
"IPFS"
Expand All @@ -61,7 +64,7 @@
},
"homepage": "https://github.com/libp2p/js-libp2p-interfaces/tree/master/packages/libp2p-peer-id-factory#readme",
"devDependencies": {
"aegir": "^36.0.1",
"aegir": "^36.1.3",
"util": "^0.12.3"
},
"dependencies": {
Expand Down
17 changes: 10 additions & 7 deletions packages/libp2p-peer-id/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@
}
},
"scripts": {
"lint": "aegir lint",
"dep-check": "aegir dep-check dist/src/**/*.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",
"dep-check": "aegir dep-check dist/src/**/*.js dist/test/**/*.js"
"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"
},
"keywords": [
"IPFS"
Expand All @@ -46,7 +49,7 @@
},
"homepage": "https://github.com/libp2p/js-libp2p-interfaces/tree/master/packages/libp2p-peer-id#readme",
"devDependencies": {
"aegir": "^36.0.1"
"aegir": "^36.1.3"
},
"dependencies": {
"@libp2p/interfaces": "^0.2.0",
Expand Down
21 changes: 12 additions & 9 deletions packages/libp2p-pubsub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,23 @@
"scripts": {
"lint": "aegir lint",
"dep-check": "aegir dep-check dist/src/**/*.js",
"build": "npm run build:types && npm run build:copy-proto-files",
"build:types": "tsc",
"build": "tsc",
"postbuild": "npm run build:copy-proto-files",
"pretest": "npm run build",
"test": "aegir test -f ./dist/test/**/*.js",
"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",
"build:proto": "npm run build:proto:rpc && npm run build:proto:topic-descriptor",
"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",
"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",
"build:proto-types": "npm run build:proto-types:rpc && npm run build:proto-types:topic-descriptor",
"build:proto-types:rpc": "pbts -o src/message/rpc.d.ts src/message/rpc.js",
"build:proto-types:topic-descriptor": "pbts -o src/message/topic-descriptor.d.ts src/message/topic-descriptor.js",
"build:copy-proto-files": "cp src/message/*.js dist/src/message && cp src/message/*.d.ts dist/src/message",
"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"
"build:copy-proto-files": "cp src/message/*.js dist/src/message && cp src/message/*.d.ts dist/src/message"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -74,7 +77,7 @@
"devDependencies": {
"@types/bl": "^5.0.2",
"@types/debug": "^4.1.7",
"aegir": "^36.0.0",
"aegir": "^36.1.3",
"protobufjs": "^6.10.2",
"util": "^0.12.4"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/libp2p-topology/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"err-code": "^3.0.1"
},
"devDependencies": {
"aegir": "^36.0.0"
"aegir": "^36.1.3"
},
"exports": {
".": {
Expand Down