forked from JohannesKlauss/react-hotkeys-hook
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.18 KB
/
publish.yml
File metadata and controls
52 lines (43 loc) · 1.18 KB
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 to npm
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "package.json"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 22.x
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm install --frozen-lockfile
- name: Lint
run: npm run lint
- name: Test
run: npm run test
env:
CI: true
- name: Build
run: npm run build
- name: Verify dist contents
run: |
echo "Contents of packages/react-hotkeys-hook/dist/:"
ls -la packages/react-hotkeys-hook/dist/
if [ ! -f packages/react-hotkeys-hook/dist/index.js ]; then
echo "ERROR: dist/index.js not found"
exit 1
fi
if [ ! -f packages/react-hotkeys-hook/dist/index.d.ts ]; then
echo "ERROR: dist/index.d.ts not found"
exit 1
fi
- name: Publish to npm
run: npm publish --tolerate-republish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}