Skip to content

Commit

Permalink
Merge pull request #1 from sealink/RB-109-initial-project
Browse files Browse the repository at this point in the history
Rb 109 initial project
  • Loading branch information
jmortlock committed Dec 7, 2021
2 parents 5978e25 + 03c48f6 commit fa4ad3a
Show file tree
Hide file tree
Showing 18 changed files with 12,166 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env"]
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/CHANGELOG.md merge=union
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'daily'
42 changes: 42 additions & 0 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and Test
on: [push, pull_request]

permissions:
pull-requests: write
contents: write

jobs:
test:
strategy:
matrix:
node: ['12', '14', '16']
name: Node ${{ matrix.node }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- run: npm install -g npm@7
- run: npm ci
- run: npm run prettier
- run: npm run test
- run: npm run coverage

# Re-enable once there are some tests
# - name: Coveralls
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}

dependabot-auto-merge:
runs-on: ubuntu-latest
needs: [test]
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
54 changes: 54 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Release
on:
push:
tags:
- '*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '14.x'
- run: npm ci
- run: npm run test

release:
needs: build
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Generate Changelog
run: |
# Get version from github ref (remove 'refs/tags/' and prefix 'v')
version="${GITHUB_REF#refs/tags/v}"
npx changelog-parser CHANGELOG.md | jq -cr ".versions | .[] | select(.version == \"$version\") | .body" > ${{ github.workflow }}-CHANGELOG.txt
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: ${{ github.workflow }}-CHANGELOG.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish:
needs: [build, release]
name: Publish
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist
node_modules
coverage
.nyc_output
npm-debug.log
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore artifacts
dist
coverage
node_modules
.nyc_output
1 change: 1 addition & 0 deletions .tools-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 16.13.1
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Unreleased

- [RB-109] Initial project setup
Empty file added index.js
Empty file.
Empty file added index.js.map
Empty file.
Empty file added lib/index.js
Empty file.
Loading

0 comments on commit fa4ad3a

Please sign in to comment.