ci: add GitHub Actions for PR type-check and npm publish on tags

This commit is contained in:
abhigyanpatwari 2026-02-23 03:59:35 +05:30
parent 5ce36d0d88
commit 7e0faa8b88
2 changed files with 48 additions and 0 deletions

20
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,20 @@
name: CI
on:
pull_request:
branches: [main]
jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: gitnexus/package-lock.json
- run: npm ci
working-directory: gitnexus
- run: npx tsc --noEmit
working-directory: gitnexus

28
.github/workflows/publish.yml vendored Normal file
View file

@ -0,0 +1,28 @@
name: Publish to npm
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
cache: npm
cache-dependency-path: gitnexus/package-lock.json
- run: npm ci
working-directory: gitnexus
- run: npx tsc --noEmit
working-directory: gitnexus
- run: npm publish
working-directory: gitnexus
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}