Skip to content

v1.2.3

v1.2.3 #14

Workflow file for this run

name: Publish to NPM
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install dependencies
run: pnpm install
- name: Run lint
run: pnpm lint
- name: Run tests
run: pnpm test:run
- name: Run build
run: pnpm build
- name: Publish to @adobe-commerce npm repo
run: |
RELEASE_TAG_NAME=${{ github.event.release.tag_name }}
SDK_VERSION=${RELEASE_TAG_NAME#v}
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
echo "Releasing version ${SDK_VERSION} to @adobe-commerce npm..."
if [[ ${SDK_VERSION} == *"alpha"* ]]; then
npm publish --tag alpha --access public
elif [[ ${SDK_VERSION} == *"beta"* ]]; then
npm publish --tag beta --access public
else
npm publish --access public
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}