Skip to content

Commit

Permalink
fix: add semantic release, switch CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Rodríguez Baquero committed Jul 23, 2021
1 parent b7a0181 commit 3ede327
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 7 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: ci

on: [push, pull_request]

jobs:
test:
name: Node ${{ matrix.node }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
node:
- '14'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- run: npm install
- run: npm run build --if-present
- run: npm test
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
push:
branches:
- master

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14
- name: Cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install dependencies
run: npm i
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
package-lock.json
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.travis.yml
test/
.github/
3 changes: 0 additions & 3 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# string2compact [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
# string2compact [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]

[travis-image]: https://img.shields.io/travis/webtorrent/string2compact/master.svg
[travis-url]: https://travis-ci.org/webtorrent/string2compact
[ci-image]: https://github.com/webtorrent/string2compact/actions/workflows/ci.yml/badge.svg
[ci-url]: https://github.com/webtorrent/string2compact/actions/workflows/ci.yml
[npm-image]: https://img.shields.io/npm/v/string2compact.svg
[npm-url]: https://npmjs.org/package/string2compact
[downloads-image]: https://img.shields.io/npm/dm/string2compact.svg
Expand Down
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"ipaddr.js": "^1.0.1"
},
"devDependencies": {
"@webtorrent/semantic-release-config": "1.0.5",
"compact2string": "^1.4.0",
"semantic-release": "17.4.4",
"standard": "*",
"tape": "^4.0.0"
},
Expand All @@ -39,5 +41,13 @@
},
"scripts": {
"test": "standard && tape test/*.js"
},
"renovate": {
"extends": [
"github>webtorrent/renovate-config"
]
},
"release": {
"extends": "@webtorrent/semantic-release-config"
}
}

0 comments on commit 3ede327

Please sign in to comment.