Skip to content

1.0.6

1.0.6 #5

Workflow file for this run

name: Release
on:
release:
types: [published]
permissions:
contents: read
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
cache: 'pnpm'
node-version: '20'
registry-url: https://registry.npmjs.org
# Get the 'version' field out of the package.json file
- name: Get package.json version
id: package-json-version
run: echo "version=$(cat package.json | jq '.version' --raw-output)" >> $GITHUB_OUTPUT
# Abort if the version in the package.json file doesn't match the tag name of the release
- name: Check package.json version against tag name
if: steps.package-json-version.outputs.version != github.event.release.tag_name
uses: actions/github-script@v3
with:
script: core.setFailed('Release tag does not match package.json version!')
- name: Install dependencies
run: pnpm install
- name: Build the package
run: pnpm build
- name: Create Publish to npm
run: pnpm publish --provenance --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}