Skip to content

Update Get started and publish it to npm #10

Update Get started and publish it to npm

Update Get started and publish it to npm #10

Workflow file for this run

name: Publish to npm
on:
push:
branches:
- 'main'
paths:
- 'examples/get-started/**'
# TODO: Remove after testing
pull_request:
branches:
- '*'
paths:
- 'examples/get-started/**'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v2
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
# Only install dev dependencies, for the binary. No need to install deps for the source code.
- name: Install dependencies
# Weird tsup quirk https://github.com/npm/cli/issues/4828#issuecomment-2404560937
run: pnpm i @rollup/rollup-linux-x64-gnu && pnpm install --dev
working-directory: ./examples/get-started
- name: Build binary
run: pnpm run build-bin
working-directory: ./examples/get-started
- name: Publish to npm
# --no-git-checks is needed because "rollup-linux-x64-gnu" is out sync
run: pnpm publish --access public --no-git-checks
working-directory: ./examples/get-started
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}