Skip to content

Merge pull request #22 from react18-tools/upgrade-deps #15

Merge pull request #22 from react18-tools/upgrade-deps

Merge pull request #22 from react18-tools/upgrade-deps #15

Workflow file for this run

name: Publish to NPM
# publish only when package json has changed - assuming version upgrade
on:
push:
branches: [main]
paths: "lib/nextjs-themes/package.json"
jobs:
publish:
if: github.event.repository.owner.login == 'react18-tools'
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
id-token: write
defaults:
run:
working-directory: ./lib/nextjs-themes
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v3
with:
registry-url: https://registry.npmjs.org
node-version: 20
- run: npm i -g pnpm && pnpm i
name: Install dependencies
# fail and not publish if any of the unit tests are failing
- name: Test
run: pnpm test
- name: Create release and Publish to NPM
run: pnpm build && pnpm publish-package && node scope.js && pnpm publish-package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.event.repository.owner.login }}
REPO: ${{ github.event.repository.name }}
# Publish lite version
- run: node lite.js && pnpm build && pnpm publish-package && node scope.js && pnpm publish-package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}