Skip to content

Commit 211c24b

Browse files
author
Diego Rodríguez Baquero
committed
fix: add semantic release, switch CI
1 parent bda5ed4 commit 211c24b

File tree

7 files changed

+76
-8
lines changed

7 files changed

+76
-8
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: ci
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
name: Node ${{ matrix.node }} / ${{ matrix.os }}
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
os:
13+
- ubuntu-latest
14+
node:
15+
- '14'
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-node@v2
19+
with:
20+
node-version: ${{ matrix.node }}
21+
- run: npm install
22+
- run: npm run build --if-present
23+
- run: npm test

.github/workflows/release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release:
10+
name: Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
with:
16+
persist-credentials: false
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v2
19+
with:
20+
node-version: 14
21+
- name: Cache
22+
uses: actions/cache@v2
23+
with:
24+
path: ~/.npm
25+
key: ${{ runner.os }}-npm-${{ hashFiles('**/package.json') }}
26+
restore-keys: |
27+
${{ runner.os }}-npm-
28+
- name: Install dependencies
29+
run: npm i
30+
env:
31+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
32+
- name: Release
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
35+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
36+
run: npx semantic-release

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
package-lock.json

.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
.travis.yml
21
test/
2+
.github/

.travis.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# bep53-range [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
1+
# bep53-range [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
22

3-
[travis-image]: https://img.shields.io/travis/webtorrent/bep53-range/master.svg
4-
[travis-url]: https://travis-ci.org/webtorrent/bep53-range
3+
[ci-image]: https://github.com/webtorrent/bep53-range/actions/workflows/ci.yml/badge.svg
4+
[ci-url]: https://github.com/webtorrent/bep53-range/actions/workflows/ci.yml
55
[npm-image]: https://img.shields.io/npm/v/bep53-range.svg
66
[npm-url]: https://npmjs.org/package/bep53-range
77
[downloads-image]: https://img.shields.io/npm/dm/bep53-range.svg

package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
"url": "https://github.com/webtorrent/bep53-range/issues"
1111
},
1212
"devDependencies": {
13+
"@webtorrent/semantic-release-config": "1.0.5",
14+
"semantic-release": "17.4.4",
1315
"standard": "*",
1416
"tape": "^5.0.1"
1517
},
@@ -27,5 +29,13 @@
2729
"range",
2830
"webtorrent"
2931
],
30-
"license": "MIT"
32+
"license": "MIT",
33+
"renovate": {
34+
"extends": [
35+
"github>webtorrent/renovate-config"
36+
]
37+
},
38+
"release": {
39+
"extends": "@webtorrent/semantic-release-config"
40+
}
3141
}

0 commit comments

Comments
 (0)