2019-09-11 02:21:22 +03:00
|
|
|
name: CI
|
|
|
|
|
2019-09-11 03:07:35 +03:00
|
|
|
on: [push, pull_request, release]
|
2019-09-11 02:21:22 +03:00
|
|
|
|
|
|
|
jobs:
|
2019-09-11 02:44:27 +03:00
|
|
|
linting:
|
|
|
|
name: Linting
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Use Node.js 8
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 8
|
|
|
|
- name: npm install
|
|
|
|
run: npm install
|
|
|
|
- name: Run linting
|
|
|
|
run: grunt compile lint
|
2019-09-11 02:28:41 +03:00
|
|
|
tests:
|
2019-09-11 02:44:27 +03:00
|
|
|
name: Tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Use Node.js 8
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 8
|
|
|
|
- name: npm install
|
|
|
|
run: npm install
|
|
|
|
- name: Run tests
|
|
|
|
run: grunt compile test
|
|
|
|
minification:
|
|
|
|
name: Minification
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Use Node.js 8
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 8
|
|
|
|
- name: npm install
|
|
|
|
run: npm install
|
|
|
|
- name: Run minification
|
|
|
|
run: grunt compile minify
|
2019-09-11 03:07:35 +03:00
|
|
|
deploy_github:
|
|
|
|
name: Deploy to GitHub Package Registry
|
2019-09-11 02:44:27 +03:00
|
|
|
needs: [linting, tests, minification]
|
2019-09-11 02:28:41 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Use Node.js 8
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 8
|
2019-09-11 03:07:35 +03:00
|
|
|
registry-url: https://npm.pkg.github.com/
|
|
|
|
scope: '@select2'
|
2019-09-11 02:44:27 +03:00
|
|
|
- name: npm install
|
2019-09-11 02:28:41 +03:00
|
|
|
run: npm install
|
2019-09-11 02:44:27 +03:00
|
|
|
- name: Run linting, tests, minify
|
2019-09-11 02:28:41 +03:00
|
|
|
run: grunt
|
2019-09-11 03:56:45 +03:00
|
|
|
- name: Deploy (release)
|
|
|
|
if: github.event_name == 'release'
|
2019-09-12 03:57:40 +03:00
|
|
|
run: npm publish
|
2019-09-11 03:56:45 +03:00
|
|
|
env:
|
|
|
|
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
- name: Deploy (release candidate)
|
2019-09-11 03:07:35 +03:00
|
|
|
if: github.event_name == 'push'
|
2019-09-11 03:56:45 +03:00
|
|
|
run: |
|
|
|
|
npm --no-git-tag-version version prerelease
|
2019-09-12 03:57:40 +03:00
|
|
|
npm publish --tag next
|
2019-09-11 03:07:35 +03:00
|
|
|
env:
|
|
|
|
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
deploy_npm:
|
|
|
|
name: Deploy to NPM
|
|
|
|
needs: [linting, tests, minification]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Use Node.js 8
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 8
|
|
|
|
registry-url: https://npm.pkg.github.com/
|
|
|
|
scope: '@select2'
|
|
|
|
- name: npm install
|
|
|
|
run: npm install
|
|
|
|
- name: Run linting, tests, minify
|
|
|
|
run: grunt
|
|
|
|
- name: Deploy
|
2019-09-12 03:57:40 +03:00
|
|
|
if: github.event_name == 'release'
|
|
|
|
run: npm publish
|
2019-09-11 03:07:35 +03:00
|
|
|
env:
|
|
|
|
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|