-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (50 loc) · 1.29 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
53
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}}