-
Notifications
You must be signed in to change notification settings - Fork 5
57 lines (47 loc) · 1.5 KB
/
publish-npm.yml
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
54
55
56
57
name: Publish to NPM
on:
workflow_dispatch: ~
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
env:
NPM_TOKEN: ${{ secrets.NPM_PAT }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Restore cached `tree-sitter-twig.wasm`.
id: cache-tree-sitter-twig
uses: actions/cache/restore@v3
with:
path: ./packages/tree-sitter-twig/tree-sitter-twig.wasm
key: |
tree-sitter-twig-${{ runner.os }}-${{
hashFiles(
'packages/tree-sitter-twig/grammar.js',
'packages/tree-sitter-twig/package.json',
'packages/tree-sitter-twig/(bindings|corpus|quieries|src)/**/*'
)
}}
- uses: pnpm/[email protected]
with:
version: 9
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'pnpm'
- run: pnpm build
- name: pnpm publish
run: |
npm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}"
pnpm publish --no-git-checks
working-directory: ./packages/language-server
- name: Cache `tree-sitter-twig.wasm`.
uses: actions/cache/save@v3
with:
path: ./packages/tree-sitter-twig/tree-sitter-twig.wasm
key: ${{ steps.cache-tree-sitter-twig.outputs.cache-primary-key }}