Skip to content

Commit

Permalink
Merge pull request #21 from rluvaton/modernize-package
Browse files Browse the repository at this point in the history
chore: modernize infra
  • Loading branch information
xpl authored Mar 3, 2024
2 parents e0a7fd1 + cc6e24e commit 2ca85ef
Show file tree
Hide file tree
Showing 13 changed files with 22,514 additions and 3,485 deletions.
5 changes: 3 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
}
}
},
"extends": ["plugin:prettier/recommended"]
}
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Node CI
on: [ push, pull_request ]

jobs:
test:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v3

- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org

- name: Install Dependencies
run: npm i

- name: Format
run: npm run format

- name: Lint
run: npm run lint

- name: Test
run: npm run test

- name: Coverage
run: npm run coveralls

deploy:
runs-on: ubuntu-22.04
needs: test

# Run only on pushing to main
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}

steps:
- name: checkout
uses: actions/checkout@v3

- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org

- name: Install Dependencies
run: npm i

- name: Build
run: npm run build

- name: Release to NPM
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# Enable npm provenance - (doing here so when we have tests that actually publish to local npm registry they won't fail)
npm_config_provenance: true
run: npx semantic-release
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,7 @@ jspm_packages
doc

# VS Code
settings.json
settings.json

# Ignore generated file
build/ansicolor.js
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "none",
"printWidth": 120
}
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

Loading

0 comments on commit 2ca85ef

Please sign in to comment.