Skip to content

Publish a package to NPM #46

Publish a package to NPM

Publish a package to NPM #46

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-javascript
- eslint-plugin-react
- eslint-plugin-testing-library
- eslint-plugin-tsoa
- eslint-plugin-typescript
- 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}}