Skip to content

Workflow file for this run

name: Publish Package and Create Release
on:
push:
tags:
- 'v*'
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Verify build artifacts
run: |
ls -R dist
[ -f dist/cjs/production/index.jsx ] || exit 1
[ -f dist/esm/production/index.jsx ] || exit 1
[ -f dist/types/index.d.ts ] || exit 1
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
dist/cjs/production/index.jsx
dist/esm/production/index.jsx
dist/types/index.d.ts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}