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

Commit

Permalink
chore: add auto-release
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Jan 26, 2022
1 parent 0b6289a commit b7fff84
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 2 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,20 @@ jobs:
- uses: GabrielBB/xvfb-action@v1
with:
run: npm run test -- -t ${{ matrix.type }} --bail -f dist/cjs/node-test/*js

release:
needs: [test-node, test-browser, test-electron]
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2.4.0
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
74 changes: 72 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,86 @@
"node": ">=16.0.0",
"npm": ">6.0.0"
},
"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"
]
},
"scripts": {
"postinstall": "cross-env node ./scripts/setup-libp2p-relay-daemon.js",
"clean": "rimraf /tmp/js-ipfs /tmp/go-ipfs ./go-libp2p-relay-daemon",
"lint": "aegir lint",
"prepare": "npm run build",
"build": "aegir build",
"pretest": "aegir build --esm-tests",
"test": "cross-env LIBP2P_TCP_REUSEPORT=false aegir test",
"test:node": "cross-env LIBP2P_TCP_REUSEPORT=false aegir test -t node -f test/node.js",
"test:browser": "cross-env LIBP2P_TCP_REUSEPORT=false aegir test -t browser -f test/browser.js",
"dep-check": "aegir dep-check package.json"
"dep-check": "aegir dep-check package.json",
"release": "semantic-release"
},
"repository": {
"type": "git",
Expand All @@ -52,7 +122,7 @@
"execa": false
},
"dependencies": {
"aegir": "^36.0.2",
"aegir": "^36.1.3",
"assert": "^2.0.0",
"buffer": "^6.0.3",
"cachedir": "^2.3.0",
Expand Down

0 comments on commit b7fff84

Please sign in to comment.