-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use semantic-release, update testing
* update polendina w/ webpack 5 and better esm support * make package.json more consistent with js-multiformats * replace test & release workflow for semantic-release & consistency
- Loading branch information
Showing
4 changed files
with
188 additions
and
93 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Test & Maybe Release | ||
on: [push, pull_request] | ||
jobs: | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node: [14.x, 16.x] | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
- name: Use Node.js ${{ matrix.node }} | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- name: Install Dependencies | ||
run: | | ||
npm install --no-progress | ||
- name: Run tests | ||
run: | | ||
npm config set script-shell bash | ||
npm run test:ci | ||
- name: Typecheck | ||
uses: gozala/[email protected] | ||
release: | ||
name: Release | ||
needs: test | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 14 | ||
- name: Install dependencies | ||
run: | | ||
npm install --no-progress --no-package-lock --no-save | ||
- name: Build | ||
run: | | ||
npm run build | ||
- name: Install plugins | ||
run: | | ||
npm install \ | ||
@semantic-release/commit-analyzer \ | ||
conventional-changelog-conventionalcommits \ | ||
@semantic-release/release-notes-generator \ | ||
@semantic-release/npm \ | ||
@semantic-release/github \ | ||
@semantic-release/git \ | ||
@semantic-release/changelog \ | ||
--no-progress --no-package-lock --no-save | ||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: npx semantic-release | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,47 +11,57 @@ | |
"build:js": "ipjs build --tests --main && npm run build:copy", | ||
"build:copy": "cp -a tsconfig.json index.js dist/ && mkdir -p dist/test && cp test/*.js dist/test/", | ||
"build:types": "npm run build:copy && cd dist && tsc --build", | ||
"publish": "ipjs publish", | ||
"test:cjs": "npm run build:js && mocha dist/cjs/node-test/test-*.js && npm run test:cjs:browser", | ||
"test:node": "hundreds mocha test/test-*.js", | ||
"test:cjs:browser": "polendina --page --worker --serviceworker --cleanup dist/cjs/node-test/test-*.js", | ||
"test:esm": "npm run build:js && mocha dist/esm/node-test/test-*.js && npm run test:esm:browser", | ||
"test:node": "c8 --check-coverage --branches 100 --functions 100 --lines 100 mocha test/test-*.js", | ||
"test:cjs:browser": "polendina --page --worker --serviceworker --cleanup dist/cjs/browser-test/test-*.js", | ||
"test:esm:browser": "polendina --page --worker --serviceworker --cleanup dist/esm/browser-test/test-*.js", | ||
"test:ts": "npm run build:types && npm run test --prefix test/ts-use", | ||
"test": "npm run lint && npm run test:node && npm run test:cjs && npm run test:ts", | ||
"test": "npm run lint && npm run test:node && npm run test:esm && npm run test:ts", | ||
"test:ci": "npm run lint && npm run test:node && npm run test:esm && npm run test:cjs && npm run test:ts", | ||
"coverage": "c8 --reporter=html mocha test/test-*.js && npm_config_yes=true npx st -d coverage -p 8080" | ||
}, | ||
"exports": { | ||
"import": "./index.js" | ||
}, | ||
"license": "(Apache-2.0 AND MIT)", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ipld/js-dag-cbor.git" | ||
}, | ||
"keywords": [ | ||
"IPFS", | ||
"IPLD" | ||
"ipfs", | ||
"ipld", | ||
"multiformats" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/ipld/js-dag-cbor/issues" | ||
"author": "Rod <[email protected]> (http://r.va.gg/)", | ||
"license": "(Apache-2.0 AND MIT)", | ||
"exports": { | ||
"import": "./index.js" | ||
}, | ||
"homepage": "https://github.com/ipld/js-dag-cbor", | ||
"dependencies": { | ||
"cborg": "^1.2.1", | ||
"multiformats": "^9.0.0" | ||
}, | ||
"devDependencies": { | ||
"buffer": "^6.0.3", | ||
"c8": "^7.10.0", | ||
"chai": "^4.3.4", | ||
"hundreds": "^0.0.9", | ||
"ipjs": "^5.0.0", | ||
"ipld-garbage": "^4.0.1", | ||
"mocha": "^9.0.0", | ||
"polendina": "^1.1.0", | ||
"standard": "^16.0.3", | ||
"typescript": "^4.2.4" | ||
"ipjs": "^5.2.0", | ||
"ipld-garbage": "^4.0.10", | ||
"mocha": "^9.1.3", | ||
"polendina": "~2.0.0", | ||
"standard": "^16.0.4", | ||
"typescript": "~4.5.2" | ||
}, | ||
"standard": { | ||
"ignore": [ | ||
"dist" | ||
] | ||
}, | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ipld/js-dag-cbor.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/ipld/js-dag-cbor/issues" | ||
}, | ||
"homepage": "https://github.com/ipld/js-dag-cbor#readme", | ||
"typesVersions": { | ||
"*": { | ||
"*": [ | ||
|
@@ -62,5 +72,90 @@ | |
] | ||
} | ||
}, | ||
"author": "Mikeal Rogers <[email protected]> (https://www.mikealrogers.com/)" | ||
"release": { | ||
"branches": [ | ||
"master" | ||
], | ||
"plugins": [ | ||
[ | ||
"@semantic-release/commit-analyzer", | ||
{ | ||
"preset": "conventionalcommits", | ||
"releaseRules": [ | ||
{ | ||
"breaking": true, | ||
"release": "major" | ||
}, | ||
{ | ||
"revert": true, | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "feat", | ||
"release": "minor" | ||
}, | ||
{ | ||
"type": "fix", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "chore", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "docs", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "test", | ||
"release": "patch" | ||
}, | ||
{ | ||
"scope": "no-release", | ||
"release": false | ||
} | ||
] | ||
} | ||
], | ||
[ | ||
"@semantic-release/release-notes-generator", | ||
{ | ||
"preset": "conventionalcommits", | ||
"presetConfig": { | ||
"types": [ | ||
{ | ||
"type": "feat", | ||
"section": "Features" | ||
}, | ||
{ | ||
"type": "fix", | ||
"section": "Bug Fixes" | ||
}, | ||
{ | ||
"type": "chore", | ||
"section": "Trivial Changes" | ||
}, | ||
{ | ||
"type": "docs", | ||
"section": "Trivial Changes" | ||
}, | ||
{ | ||
"type": "test", | ||
"section": "Tests" | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"@semantic-release/changelog", | ||
[ | ||
"@semantic-release/npm", | ||
{ | ||
"pkgRoot": "dist" | ||
} | ||
], | ||
"@semantic-release/github", | ||
"@semantic-release/git" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters