Skip to content

Commit

Permalink
chore: use semantic-release, update testing
Browse files Browse the repository at this point in the history
* 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
rvagg committed Dec 9, 2021
1 parent 4a7bfc2 commit 8735b23
Show file tree
Hide file tree
Showing 3 changed files with 182 additions and 77 deletions.
50 changes: 0 additions & 50 deletions .github/workflows/mikeals-workflow.yml

This file was deleted.

63 changes: 63 additions & 0 deletions .github/workflows/test-and-release.yml
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/checkout@v2.4.0
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v2.5.0
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/typescript-error-reporter-action@v1.0.8
release:
name: Release
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v2.4.0
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2.5.0
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

146 changes: 119 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,51 +11,58 @@
"build:js": "ipjs build --tests --main && npm run build:copy",
"build:copy": "cp -a tsconfig.json src *.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": "./src/index.js"
},
"license": "(Apache-2.0 AND MIT)",
"repository": {
"type": "git",
"url": "https://github.com/ipld/js-dag-pb.git"
},
"keywords": [
"IPFS",
"IPLD"
"ipfs",
"ipld",
"multiformats"
],
"bugs": {
"url": "https://github.com/ipld/js-dag-pb/issues"
"author": "Rod <rod@vagg.org> (http://r.va.gg/)",
"license": "(Apache-2.0 AND MIT)",
"exports": {
"import": "./src/index.js"
},
"homepage": "https://github.com/ipld/js-dag-pb",
"dependencies": {
"multiformats": "^9.0.0"
"multiformats": "^9.5.4"
},
"devDependencies": {
"@types/chai": "^4.2.16",
"@types/chai": "^4.3.0",
"@types/mocha": "^9.0.0",
"chai": "^4.2.0",
"c8": "^7.10.0",
"chai": "^4.3.4",
"chai-subset": "^1.6.0",
"hundreds": "^0.0.9",
"ipjs": "^5.0.0",
"mocha": "^9.0.0",
"polendina": "^1.1.0",
"standard": "^16.0.3",
"typescript": "^4.2.3"
"ipjs": "^5.2.0",
"mocha": "^9.1.3",
"polendina": "~2.0.1",
"standard": "^16.0.4",
"typescript": "~4.5.2"
},
"standard": {
"ignore": [
"dist",
"test/ts-use/src/main.js"
]
},
"directories": {
"test": "test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ipld/js-dag-pb.git"
},
"bugs": {
"url": "https://github.com/ipld/js-dag-pb/issues"
},
"homepage": "https://github.com/ipld/js-dag-pb#readme",
"typesVersions": {
"*": {
"*": [
Expand All @@ -66,5 +73,90 @@
]
}
},
"author": "Rod Vagg <r@va.gg>"
"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"
]
}
}

0 comments on commit 8735b23

Please sign in to comment.