@@ -2,75 +2,20 @@ name: Build Prebuilds
22
33on :
44 push :
5- branches : [main, master]
5+ branches :
6+ - main
7+ - master
8+ pull_request :
69 workflow_dispatch :
710
8- jobs :
9- build :
10- runs-on : ${{ matrix.os }}
11- strategy :
12- matrix :
13- os : [ubuntu-latest, macos-latest]
14-
15- steps :
16- - uses : actions/checkout@v4
17- with :
18- submodules : recursive
19-
20- - uses : actions/setup-node@v4
21- with :
22- node-version : 22
23-
24- - run : npm install
25- - run : npx prebuildify --napi --strip || echo "Prebuildify may have failed"
26-
27- - uses : actions/upload-artifact@v4
28- with :
29- name : prebuilds-${{ matrix.os }}
30- path : prebuilds/
31- if-no-files-found : ignore
32-
33- publish :
34- needs : build
35- runs-on : ubuntu-latest
36- if : github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
37-
38- steps :
39- - uses : actions/checkout@v4
40- with :
41- submodules : recursive
42- token : ${{ secrets.GITHUB_TOKEN }}
11+ concurrency :
12+ group : ${{github.workflow}}-${{github.ref}}
13+ cancel-in-progress : true
4314
44- - name : Configure Git
45- run : |
46- git config user.name "github-actions[bot]"
47- git config user.email "github-actions[bot]@users.noreply.github.com"
48-
49- - uses : actions/setup-node@v4
50- with :
51- node-version : 22
52- registry-url : https://registry.npmjs.org
53-
54- - uses : actions/download-artifact@v4
55- with :
56- path : artifacts
57-
58- - name : Merge prebuilds
59- run : |
60- mkdir -p prebuilds
61- find artifacts -type f -name "*.node" | while read src; do
62- platform=$(basename $(dirname $(dirname "$src")) | sed 's/prebuilds-//')
63- mkdir -p "prebuilds/$platform"
64- cp "$src" "prebuilds/$platform/"
65- done
66- ls -R prebuilds/ || echo "No prebuilds found"
67-
68- - run : npm install
69-
70- - name : Bump version and publish
71- run : |
72- npm version patch -m "chore: release %s with prebuilds"
73- git push && git push --tags
74- npm publish --access public
75- env :
76- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
15+ jobs :
16+ npm :
17+ uses : tree-sitter/workflows/.github/workflows/package-npm.yml@main
18+ secrets :
19+ NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
20+ with :
21+ generate : false
0 commit comments