-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (49 loc) · 1.35 KB
/
npm-publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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-plugin-api-documentation
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
- run: npx publint --strict
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}}