Skip to content

Commit

Permalink
Merge pull request #1 from SERPHouse/initi_commit
Browse files Browse the repository at this point in the history
serphouse-nodejs npm package
  • Loading branch information
mehulvadodariya2012 authored May 10, 2024
2 parents bf0573d + ad71742 commit f63a07a
Show file tree
Hide file tree
Showing 26 changed files with 1,524 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: ESLint and Prettier Check

on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:

jobs:
lint:
name: ESLint and Prettier Check
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "16"

- name: Install dependencies
run: npm install

- name: Run ESLint
run: npm run lint

- name: Run Prettier
run: npx prettier --check prettierrc.js
33 changes: 33 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{vars.NPM_KEY}}
28 changes: 28 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: run-tests

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
workflow_dispatch:

jobs:
run-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "16"

- name: Install dependencies
run: npm install

- name: Run tests
run: npm test
env:
API_KEY: ${{ vars.API_KEY }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules/
package-lock.json

Loading

0 comments on commit f63a07a

Please sign in to comment.