on master help sign in
Use a minimal binary to fetch grammar sources in release CI (#2557)
0035c29Michael Davis
.github/workflows/release.yml+1−3
@@ -23,11 +23,9 @@ jobs:
23
23
24 - name: Fetch tree-sitter grammars
24 - name: Fetch tree-sitter grammars
25 uses: actions-rs/cargo@v1
25 uses: actions-rs/cargo@v1
26− env:
27− HELIX_DISABLE_AUTO_GRAMMAR_BUILD: yes
28 with:
26 with:
29 command: run
27 command: run
30− args: -- --grammar fetch
28+ args: --package=helix-loader --bin=hx-loader
31
29
32 - name: Bundle grammars
30 - name: Bundle grammars
33 run: tar cJf grammars.tar.xz -C runtime/grammars/sources .
31 run: tar cJf grammars.tar.xz -C runtime/grammars/sources .
helix-loader/Cargo.toml+4−1
@@ -9,6 +9,10 @@ categories = ["editor"]
9repository = "https://github.com/helix-editor/helix"
9repository = "https://github.com/helix-editor/helix"
10homepage = "https://helix-editor.com"
10homepage = "https://helix-editor.com"
11
11
12+[[bin]]
13+name = "hx-loader"
14+path = "src/main.rs"
15+
12[dependencies]
16[dependencies]
13anyhow = "1"
17anyhow = "1"
14serde = { version = "1.0", features = ["derive"] }
18serde = { version = "1.0", features = ["derive"] }
@@ -27,4 +31,3 @@ threadpool = { version = "1.0" }
27
31
28[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
32[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
29libloading = "0.7"
33libloading = "0.7"
30−
helix-loader/src/main.rsnew file+9
@@ -0,0 +1,9 @@
1+use anyhow::Result;
2+use helix_loader::grammar::fetch_grammars;
3+
4+// This binary is used in the Release CI as an optimization to cut down on
5+// compilation time. This is not meant to be run manually.
6+
7+fn main() -> Result<()> {
8+ fetch_grammars()
9+}