Skip to content

Publish a package to NPM #37

Publish a package to NPM

Publish a package to NPM #37

Workflow file for this run

name: Publish a package to NPM
on:
workflow_dispatch:
inputs:
package:
description: 'Package'
required: true
type: choice
options:
- eslint-plugin-no-destructuring-arrays-as-objects
- eslint-plugin-no-testing-library-without-cleanup
- eslint-plugin-redux-use-app-functions
- eslint-plugin-report-caught-error
- eslint-plugin-require-useeffect-dependency-array
- eslint-config
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.package }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run build --if-present
- run: npm test --if-present
- run: npx publint --strict
- run: npx @arethetypeswrong/cli --pack
publish-npm:
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write
defaults:
run:
working-directory: ${{ inputs.package }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build --if-present
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}