Skip to content

feat: Instrument LLM-Shield as Agentics Foundational Execution Unit #26

feat: Instrument LLM-Shield as Agentics Foundational Execution Unit

feat: Instrument LLM-Shield as Agentics Foundational Execution Unit #26

Workflow file for this run

name: Publish to NPM
on:
push:
branches:
- main
workflow_dispatch:
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Type check
run: npm run typecheck
- name: Build WASM
working-directory: packages/core
run: |
chmod +x scripts/build-wasm.sh
./scripts/build-wasm.sh
- name: Build package
working-directory: packages/core
run: npm run build
- name: Run tests
working-directory: packages/core
run: npm test
- name: Check bundle size
working-directory: packages/core
run: npm run size
- name: Verify package
working-directory: packages/core
run: npm run validate
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
working-directory: packages/core
run: npx semantic-release
- name: Publish to NPM (provenance)
if: steps.release.outputs.new_release_published == 'true'
working-directory: packages/core
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
publish-docs:
name: Publish Documentation
runs-on: ubuntu-latest
needs: release
if: needs.release.outputs.new_release_published == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build docs
working-directory: docs
run: npm run build
- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
vercel-args: '--prod'
working-directory: docs
notify:
name: Notify Release
runs-on: ubuntu-latest
needs: [release, publish-docs]
if: needs.release.outputs.new_release_published == 'true'
steps:
- name: Send Slack notification
uses: slackapi/slack-github-action@v1.24.0
with:
webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
payload: |
{
"text": "New release: @llm-shield/core v${{ needs.release.outputs.new_release_version }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":rocket: *New Release Published*\n\n*Package:* @llm-shield/core\n*Version:* ${{ needs.release.outputs.new_release_version }}\n*Release Notes:* ${{ needs.release.outputs.new_release_url }}"
}
}
]
}
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ needs.release.outputs.new_release_version }}
release_name: v${{ needs.release.outputs.new_release_version }}
body: ${{ needs.release.outputs.new_release_notes }}
draft: false
prerelease: false