Skip to content
Open
Show file tree
Hide file tree
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
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16, 18, 20]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
Comment on lines +20 to +24
run: npm install --ignore-scripts

- name: Build library
run: npm run build

- name: Verify dist output
run: |
test -f dist/index.js || (echo "dist/index.js not found" && exit 1)
test -f dist/index.d.ts || (echo "dist/index.d.ts not found" && exit 1)
echo "✅ dist/ output verified"

- name: Check package contents
run: npm pack --dry-run
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish to npm

on:
release:
types: [published]
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org

Comment on lines +19 to +23
- name: Install dependencies
run: npm install --ignore-scripts

- name: Build library
run: npm run build

- name: Verify dist output
run: |
test -f dist/index.js || (echo "dist/index.js not found" && exit 1)
test -f dist/index.d.ts || (echo "dist/index.d.ts not found" && exit 1)
echo "✅ dist/ output verified"

- name: Publish to npm
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
.eslintcache
package-lock.json
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
/node_modules
/.pnp
.pnp.js
/dist

# testing
/coverage
Expand Down
Loading
Loading