Skip to content

Publish Package

Publish Package #68

Workflow file for this run

name: Publish Package
on:
push:
tags:
- "pages-components*" # Push events to matching pages-components*, i.e. pages-components@1.0.0
permissions:
id-token: write # Required for OIDC
jobs:
publish:
# prevents this action from running on forks
if: github.repository == 'yext/js'
runs-on: ubuntu-latest
environment: Release
steps:
- name: Checkout
uses: actions/checkout@v4.1.6
with:
ref: ${{ github.ref }}
- name: Install pnpm
uses: pnpm/action-setup@v4.0.0
- name: Set node version to 20.x
uses: actions/setup-node@v4.0.2
with:
node-version: 20.x
registry-url: https://registry.npmjs.org/
cache: "pnpm"
- name: Install deps
run: pnpm install --ignore-scripts --frozen-lockfile
- name: Update npm
# npm version npm 11.5.1 or later needed for Trusted Publishing
run: npm install -g npm@latest
- name: Verify package version and get npm tag
id: get_npm_tag
run: |
TAG=$(pnpm run ci-verify-publish ${{ github.ref_name }} | tail -n 1)
echo "npm_tag=$TAG" >> $GITHUB_OUTPUT
- name: Publish
run: |
cd packages/pages-components
pnpm publish --access public --tag ${{ steps.get_npm_tag.outputs.npm_tag }} --no-git-checks