Skip to content

3.4.0

3.4.0 #47

Workflow file for this run

name: Publish NPM Package
on:
release:
types:
- published
workflow_dispatch:
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup
uses: ./.github/actions/setup
- name: Determine NPM tag
id: npm-tag
run: |
# Read the version from package.json
VERSION=$(node -p "require('./modules/@shopify/checkout-sheet-kit/package.json').version")
# Check if it's a "beta" or "rc" version
if [[ "$VERSION" == *"-beta"* ]] || [[ "$VERSION" == *"-rc"* ]]; then
echo "Version $VERSION is a prerelease, using 'next' tag"
echo "tag=next" >> $GITHUB_OUTPUT
else
echo "Version $VERSION is a stable release, using 'latest' tag"
echo "tag=latest" >> $GITHUB_OUTPUT
fi
- name: Prepare release
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
cp README.md modules/@shopify/checkout-sheet-kit
yarn module clean
yarn module build
cd modules/@shopify/checkout-sheet-kit
npm publish --access public --tag ${{ steps.npm-tag.outputs.tag }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}