Skip to content

🚀 Publish to NPM Dev Channel #8

🚀 Publish to NPM Dev Channel

🚀 Publish to NPM Dev Channel #8

Workflow file for this run

name: 🚀 Publish to NPM Dev Channel
on:
workflow_dispatch
env:
NODE_VERSION: '20.x'
PNPM_VERSION: '10'
permissions:
contents: read
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: 🔄 Checkout code
uses: actions/checkout@v4
- name: ⚙️ Setup Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org/
- name: 📦 Install pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: 📌 Install dependencies
run: pnpm install --frozen-lockfile
- name: 🛠️ Run build
run: pnpm run build
- name: 🔖 Update package version
id: update-version
run: |
CURRENT_VERSION=$(node -p "require('./package.json').version")
TIMESTAMP=$(date -u +"%Y%m%d%H%M%S")
NEW_VERSION="${CURRENT_VERSION}-dev${TIMESTAMP}"
pnpm version --no-git-tag-version $NEW_VERSION
echo "New version: $NEW_VERSION"
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
- name: 🔄 Update package-lock.json
run: pnpm install
- name: 📤 Publish to NPM Dev Channel
run: pnpm publish --tag dev --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}