Skip to content

Commit

Permalink
add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kremalicious committed May 10, 2022
1 parent 9f2a69d commit 7968e44
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: npm
directory: '/'
schedule:
interval: monthly
time: '04:00'
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'CI'

on:
push:
branches:
- main
tags:
- '**'
pull_request:
branches:
- '**'

jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: ['14']

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}

- run: npm ci
- run: npm test
27 changes: 27 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'Publish'

on:
push:
tags:
- '**'

jobs:
npm:
runs-on: ubuntu-latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
registry-url: https://registry.npmjs.org/
- run: npm ci

# pre-releases, triggered by `next` as part of git tag
- run: npm publish --tag next
if: ${{ contains(github.ref, 'next') }}

# production releases
- run: npm publish
if: ${{ !contains(github.ref, 'next') }}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
},
"release-it": {
"hooks": {
"before:init": "npm test",
"after:bump": "npm run changelog"
},
"git": {
Expand All @@ -53,7 +54,7 @@
"release": true
},
"npm": {
"publish": true
"publish": false
}
}
}

0 comments on commit 7968e44

Please sign in to comment.