Skip to content

0.0.3

0.0.3 #4

Workflow file for this run

name: Plugin Release
on:
release:
types: [published]
permissions:
contents: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Update npm
run: npm install -g npm@latest
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm run build
- name: Verify tag matches package version
run: |
PKG_VERSION=$(node -p "require('./packages/plugin/package.json').version")
if [ -n "${{ github.event.release.tag_name }}" ]; then
RAW_TAG="${{ github.event.release.tag_name }}"
else
RAW_TAG="${GITHUB_REF#refs/tags/}"
fi
TAG_VERSION="${RAW_TAG#v}"
if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
echo "Tag version ($TAG_VERSION) does not match package.json version ($PKG_VERSION)"
exit 1
fi
- name: Publish to NPM
working-directory: ./packages/plugin
run: npm publish --access public