Add deploying to GPM and NPM
This also adds a handler for the release event, which is what we want to be using for pushing NPM builds out.
This commit is contained in:
parent
ffd98a493b
commit
91838fe0a6
36
.github/workflows/main.yml
vendored
36
.github/workflows/main.yml
vendored
@ -1,6 +1,6 @@
|
|||||||
name: CI
|
name: CI
|
||||||
|
|
||||||
on: [push, pull_request]
|
on: [push, pull_request, release]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
linting:
|
linting:
|
||||||
@ -42,8 +42,8 @@ jobs:
|
|||||||
run: npm install
|
run: npm install
|
||||||
- name: Run minification
|
- name: Run minification
|
||||||
run: grunt compile minify
|
run: grunt compile minify
|
||||||
deploy:
|
deploy_github:
|
||||||
name: Deploy
|
name: Deploy to GitHub Package Registry
|
||||||
needs: [linting, tests, minification]
|
needs: [linting, tests, minification]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@ -52,9 +52,35 @@ jobs:
|
|||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 8
|
node-version: 8
|
||||||
|
registry-url: https://npm.pkg.github.com/
|
||||||
|
scope: '@select2'
|
||||||
- name: npm install
|
- name: npm install
|
||||||
run: npm install
|
run: npm install
|
||||||
- name: Run linting, tests, minify
|
- name: Run linting, tests, minify
|
||||||
run: grunt
|
run: grunt
|
||||||
- name: Deploy to NPM
|
- name: Deploy
|
||||||
run: "echo 'We made it here'"
|
if: github.event_name == 'push'
|
||||||
|
run: npm publish
|
||||||
|
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
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
run: npm publish
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
||||||
|
Loading…
Reference in New Issue
Block a user