@@ -45,185 +45,14 @@ jobs:
4545 file_pattern : src
4646 add_options : -f
4747
48- deploy-npm :
49- runs-on : ubuntu-latest
48+ npm :
5049 needs : test
51- steps :
52- - uses : actions/checkout@v4
53- - uses : actions/setup-node@v4
54- with :
55- node-version : latest
56- registry-url : https://registry.npmjs.org
57- - name : Install dependencies
58- run : |
59- npm install -g tree-sitter-cli bun
60- tree-sitter init -u
61- tree-sitter generate
62- bun install --ignore-scripts
63- - name : Build
64- run : |
65- npm pack
66- env :
67- NODE_ENV : production
68- - uses : softprops/action-gh-release@v2
69- if : startsWith(github.ref, 'refs/tags/')
70- with :
71- files : " *.tgz"
72- - name : Publish
73- if : startsWith(github.ref, 'refs/tags/')
74- env :
75- NODE_ENV : production
76- run : |
77- npm publish
50+ uses : tree-sitter/workflows/.github/workflows/package-npm.yml@main
7851
79- deploy-cargo :
80- runs-on : ubuntu-latest
52+ crates :
8153 needs : test
82- steps :
83- - uses : actions/checkout@v4
84- - uses : actions-rust-lang/setup-rust-toolchain@v1
85- with :
86- toolchain : nightly
87- - uses : actions/setup-node@v4
88- with :
89- node-version : latest
90- registry-url : https://registry.npmjs.org
91- - name : Install dependencies
92- run : |
93- npm install -g tree-sitter-cli
94- tree-sitter init -u
95- tree-sitter generate
96- - name : Build
97- run : |
98- cargo package
99- - uses : softprops/action-gh-release@v2
100- if : startsWith(github.ref, 'refs/tags/')
101- with :
102- files : " target/package/*.crate"
103- - name : Publish
104- if : startsWith(github.ref, 'refs/tags/')
105- run : |
106- cargo publish --token ${{secrets.CARGO_TOKEN}}
54+ uses : tree-sitter/workflows/.github/workflows/package-crates.yml@main
10755
108- deploy-luarocks :
109- runs-on : ubuntu-latest
56+ pypi :
11057 needs : test
111- steps :
112- - uses : actions/checkout@v4
113- - uses : leafo/gh-actions-lua@v12
114- with :
115- luaVersion : " 5.1"
116- - uses : leafo/gh-actions-luarocks@v6
117- - name : Install dependencies
118- run : |
119- luarocks install tree-sitter-cli
120- - uses : lumen-oss/luarocks-tag-release@v7
121- env :
122- LUAROCKS_API_KEY : ${{secrets.LUAROCKS_API_KEY}}
123- if : " ! startsWith(github.ref, 'refs/tags/')"
124- with :
125- extra_luarocks_args : |
126- --force
127- version : scm
128- template : tree-sitter-expando-scm-1.rockspec
129- - uses : lumen-oss/luarocks-tag-release@v7
130- env :
131- LUAROCKS_API_KEY : ${{secrets.LUAROCKS_API_KEY}}
132- if : startsWith(github.ref, 'refs/tags/')
133- with :
134- extra_luarocks_args : |
135- --force
136- template : tree-sitter-expando-scm-1.rockspec
137- - run : |
138- luarocks install tree-sitter-expando
139- luarocks pack tree-sitter-expando
140- scripts/upload.sh ./*.rock
141- env:
142- LUAROCKS_API_KEY: ${{secrets.LUAROCKS_API_KEY}}
143- if: startsWith(github.ref, 'refs/tags/')
144-
145- deploy-luarocks-macos :
146- needs : deploy-luarocks
147- runs-on : macos-latest
148- if : startsWith(github.ref, 'refs/tags/')
149- steps :
150- - uses : actions/checkout@v4
151- - uses : leafo/gh-actions-lua@v12
152- with :
153- luaVersion : " 5.1"
154- - uses : leafo/gh-actions-luarocks@v6
155- - run : |
156- luarocks install tree-sitter-cli
157- luarocks install tree-sitter-expando
158- luarocks pack tree-sitter-expando
159- scripts/upload.sh ./*.rock
160- env:
161- LUAROCKS_API_KEY: ${{secrets.LUAROCKS_API_KEY}}
162-
163- build-wheels :
164- needs : test
165- strategy :
166- fail-fast : false
167- matrix :
168- runs-on :
169- - ubuntu-latest
170- - macos-latest
171- - windows-latest
172- runs-on : ${{matrix.runs-on}}
173- steps :
174- - uses : actions/checkout@v4
175- - uses : docker/setup-qemu-action@v3
176- if : runner.os == 'Linux'
177- - uses : actions/setup-node@v4
178- with :
179- node-version : latest
180- registry-url : https://registry.npmjs.org
181- - name : Install dependencies
182- run : |
183- npm install -g tree-sitter-cli
184- tree-sitter init -u
185- tree-sitter generate
186- - uses : pypa/cibuildwheel@v2.16
187- - uses : actions/upload-artifact@v4
188- with :
189- name : artifact-${{matrix.runs-on}}
190- path : |
191- wheelhouse/*.whl
192-
193- build :
194- needs :
195- - build-wheels
196- runs-on : ubuntu-latest
197- steps :
198- - uses : actions/checkout@v4
199- - uses : actions/setup-node@v4
200- with :
201- node-version : latest
202- registry-url : https://registry.npmjs.org
203- - name : Install dependencies
204- run : |
205- npm install -g tree-sitter-cli
206- tree-sitter init -u
207- tree-sitter generate
208- - uses : astral-sh/setup-uv@v8.3.2
209- - name : Build
210- run : |
211- uv build --sdist
212- - uses : actions/upload-artifact@v4
213- if : " ! startsWith(github.ref, 'refs/tags/')"
214- with :
215- name : artifact-sdist
216- path : |
217- dist/*
218- - uses : actions/download-artifact@v4
219- with :
220- pattern : artifact-*
221- merge-multiple : true
222- path : dist
223- - uses : softprops/action-gh-release@v2
224- if : startsWith(github.ref, 'refs/tags/')
225- with :
226- files : |
227- dist/*
228- - uses : pypa/gh-action-pypi-publish@release/v1
229- if : startsWith(github.ref, 'refs/tags/')
58+ uses : tree-sitter/workflows/.github/workflows/package-pypi.yml@main
0 commit comments