Skip to content

Workflow file for this run

name: Publish package to GitHub Packages
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
- name: Set package version
run: |
# Commit the updated package.json
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
# Update the package.json version
yarn version --new-version ${{ github.event.release.tag_name }}
- name: Install dependencies
run: yarn install --frozen-lockfile
- run: yarn build
- run: yarn publish --new-version ${{ github.event.release.tag_name }} --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}