Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Node CI/CD

on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20] # Test against multiple Node versions
steps:
- uses: actions/checkout@v2

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm install

# - name: Run Lint
# run: npm run lint

# - name: Run Tests
# run: npm test

publish:
needs: build
runs-on: ubuntu-latest
# if: github.event_name == 'release'
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2

- name: Set up Node.js for Publishing
uses: actions/setup-node@v3
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'

- name: Install Dependencies
run: npm install

# Uncomment if you have a build step
# - name: Build Package
# run: npm run build

- name: Publish Package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish