Skip to content

Publish Package to npm #5

Publish Package to npm

Publish Package to npm #5

Workflow file for this run

name: Publish
on:
release:
types: [published]
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.target_commitish }}
- name: Enable corepack
run: corepack enable pnpm
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- run: pnpm install
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest
- name: Run Biome
run: biome ci .
- name: Install Playwright Browsers
run: pnpm exec playwright install chromium
- name: Test
run: pnpm test
- name: Set up git
run: |
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com'
git config --local user.name 'github-actions[bot]'
- name: Bump version to ${{ github.event.release.tag_name }}
run: |
pnpm version ${{ github.event.release.tag_name }}
git add .
git commit -m "${{ github.event.release.tag_name }}"
- name: Publish
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
pnpm config set //registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}
pnpm publish --no-git-checks
- name: Push changes
run: git push
env:
github-token: ${{ secrets.GITHUB_TOKEN }}