Migrate from Travis CI to GitHub Actions

This commit is contained in:
Jia Hao 2020-11-22 02:28:14 +00:00 committed by GitHub
parent b821ade761
commit 59accaba8d
4 changed files with 56 additions and 31 deletions

33
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: ci
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
strategy:
matrix:
node-version:
- 15.x
- 14.x # Changing this? Remind to keep linter conditions below and in publish.yml aligned.
- 12.x
- 10.x
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm run dev-up
- run: npm run build
# Only run linter once, for faster CI. Align the verisons of Node here with above and publish.yml.
- if: matrix.platform == 'ubuntu-latest' && matrix.node-version == '14.x'
run: npm run lint
- run: npm test

22
.github/workflows/publish.yml vendored Normal file
View File

@ -0,0 +1,22 @@
name: publish
on:
release:
types:
- created
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v1
with:
# Align the version of Node here with ci.yml.
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- run: npm run dev-up
- run: npm run build
- run: npm test
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

View File

@ -1,30 +0,0 @@
language: node_js
os:
- linux
- osx
- windows
node_js:
- '15'
- '14' # Changing this? Remind to keep linter+deploy conditions below aligned
- '12'
- '10'
install:
- rm -rf lib/ app/lib/ app/dist/ node_modules/ app/node_modules/
- npm run dev-up
- npm run build
script:
# Only run linter once, for faster CI. Remind to keep linter+deploy conditions below aligned
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$TRAVIS_NODE_VERSION" = "14" ]; then npm run lint; fi
- npm test
# https://docs.travis-ci.com/user/deployment
deploy:
provider: npm
skip_cleanup: true
email: jiahaog@gmail.com
api_token:
secure: al3oL4T5teMYt8GBAN1yx1l5Q25opB2LxYCAl6mbdnuhFBHO47aUnbEa/xJc2B0s6E9S8gJR2pYkg02WBPhr94GU+Pg3Gi/Lu8SqBLbrUzB4PT1ow30aoGIi4qaCvjRSbFuHr1I3gF/OZwcVlibU2C8GHArG2AV+TC2Krpsr6aa4V2qGmJwUMNP+rok2k9YZuUIB5lt8ZONwykYLrDxLOKZiZJ9nCLRBwJLpEUp4+z4k8zE7OTiU8/lFQMUV+WSvZVjjV+d8UCnLGN8LplZGY+VSAoh3JjrTTgXLkoT2EeZ1GFdhToanZnVkcrkT5BgNTEfq3OPB/rkqgCtwCUrOuudJE1uoXauVbYM7EwuahdRFC89Z9VBSHdsSw8Qk4cgSphS+U4+G3/+7oel8zWdHrH+iDj+YWFyB0WeyBvCqiqqzjwTo1Zjw6zzKUQxnmuhBEJ94jktTNV+ixV58VAy+oFecAFB4D8JMIw/ibgoB5ZJJdB8iRmrjhJoUjvUY8S7RpilcieDt0NO0h0y8/Qk0XLy/hgyuohsAsrl/lz4qP/dJVGVO6eSHVSn6tGUbMPymKKY5/s9czQT0fd6zE1ajdefva0YuePsuVVba1OophZM3UtfxPl7mwWiruTlRqwySa287a7ugTIM4wrO4T98zz0aqkYCJoZ9hgdYryrngRvM=
on:
tags: true
repo: jiahaog/nativefier
node_js: '14' # Remind to keep linter+deploy conditions above aligned
condition: '$TRAVIS_OS_NAME = linux'

View File

@ -1,6 +1,6 @@
# Nativefier
[![Build Status](https://travis-ci.org/jiahaog/nativefier.svg)](https://travis-ci.org/jiahaog/nativefier)
[![Build Status](https://github.com/jiahaog/nativefier/workflows/.github/workflows/ci.yml/badge.svg)
[![npm version](https://badge.fury.io/js/nativefier.svg)](https://www.npmjs.com/package/nativefier)
![Dock](docs/dock.png)