Skip to content

Commit b91e35e

Browse files
committed
use github testing
1 parent 020b2ca commit b91e35e

File tree

3 files changed

+79
-21
lines changed

3 files changed

+79
-21
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Test and Release
2+
3+
# Run this job on all pushes and pull requests
4+
# as well as tags with a semantic version
5+
on:
6+
push:
7+
branches:
8+
- "*"
9+
tags:
10+
- "v[0-9]+.[0-9]+.[0-9]+"
11+
pull_request: {}
12+
13+
jobs:
14+
# Runs tests on all supported node versions and OSes
15+
tests:
16+
if: contains(github.event.head_commit.message, '[skip ci]') == false
17+
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
matrix:
21+
node-version: [8.x, 10.x, 12.x]
22+
os: [ubuntu-latest, windows-latest, macos-latest]
23+
exclude:
24+
# Don't test Node.js 8 on Windows. npm is weird here
25+
- os: windows-latest
26+
node-version: 8.x
27+
steps:
28+
- uses: actions/checkout@v1
29+
- name: Use Node.js ${{ matrix.node-version }}
30+
uses: actions/setup-node@v1
31+
with:
32+
node-version: ${{ matrix.node-version }}
33+
34+
- name: Install package
35+
run: npm i
36+
37+
- name: Run unit tests
38+
run: npm run test
39+
40+
# Deploys the final package to NPM
41+
deploy:
42+
needs: [tests]
43+
44+
# Trigger this step only when a commit on master is tagged with a version number
45+
if: |
46+
contains(github.event.head_commit.message, '[skip ci]') == false &&
47+
github.event_name == 'push' &&
48+
github.event.base_ref == 'refs/heads/master' &&
49+
startsWith(github.ref, 'refs/tags/v')
50+
51+
runs-on: ubuntu-latest
52+
strategy:
53+
matrix:
54+
node-version: [12.x]
55+
56+
steps:
57+
- uses: actions/checkout@v1
58+
- name: Use Node.js ${{ matrix.node-version }}
59+
uses: actions/setup-node@v1
60+
with:
61+
node-version: ${{ matrix.node-version }}
62+
63+
- name: Install package
64+
run: npm i
65+
66+
- name: Publish package to npm
67+
run: |
68+
npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
69+
npm whoami
70+
npm publish
71+
72+
# Dummy job for skipped builds - without this, github reports the build as failed
73+
skip-ci:
74+
if: contains(github.event.head_commit.message, '[skip ci]')
75+
runs-on: ubuntu-latest
76+
steps:
77+
- name: Skip build
78+
run: echo "Build skipped!"

.travis.yml

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

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# Node-Bring-Shopping
22
[![NPM version](http://img.shields.io/npm/v/bring-shopping.svg)](https://www.npmjs.com/package/bring-shopping)
33
[![Downloads](https://img.shields.io/npm/dm/bring-shopping.svg)](https://www.npmjs.com/package/bring-shopping)
4-
[![Build Status](https://travis-ci.org/foxriver76/node-bring-api.svg?branch=master)](https://travis-ci.org/foxriver76/node-bring-api) [![Greenkeeper badge](https://badges.greenkeeper.io/foxriver76/node-bring-api.svg)](https://greenkeeper.io/)
5-
4+
![Build Status](https://github.com/foxriver76/node-bring-api/workflows/Test%20and%20Release/badge.svg)
65

76
A node module for Bring! shopping lists.
87

0 commit comments

Comments
 (0)