Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

undep

undep #9

Workflow file for this run

name: Publish (NPM & GPR)
# publish only when package json has changed - assuming version upgrade
on:
push:
branches: [main]
paths: "packages/esbuild-plugin-removetestid/package.json"
jobs:
publish:
# Don't run just after creating repo from template
# Also avoid running after merging set-up PR
runs-on: ubuntu-latest
permissions: write-all
defaults:
run:
working-directory: ./packages/esbuild-plugin-removetestid
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org
- run: npm i -g pnpm && pnpm i
name: Install dependencies
- name: Update topics and Publish to NPM
run: pnpm build && pnpm publish-package
# continue on error to publish scoped package name <- by default repo is setup for a non-scoped + scoped package name
continue-on-error: true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.event.repository.owner.login }}
REPO: ${{ github.event.repository.name }}
- name: Publish Scoped package to NPM
# continue on error - expecing npm to trow error if scoping is done twice
continue-on-error: true
id: publish_scoped
run: cd dist && node ../scope.js && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.event.repository.owner.login }}
REPO: ${{ github.event.repository.name }}
- uses: actions/setup-node@v3
with:
registry-url: https://npm.pkg.github.com/
- name: Publish to GitHub Public Repository
run: pnpm publish-package
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}