Skip to content

Commit f226339

Browse files
committed
test build
1 parent b3fc3cc commit f226339

File tree

3 files changed

+42
-14
lines changed

3 files changed

+42
-14
lines changed

.github/workflows/build.yml

+2-12
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,9 @@ jobs:
4848
cargo install cross
4949
cross build --release --target ${{ matrix.target }} --features no_format -p luals
5050
51-
- name: package-unix
52-
if: ${{ matrix.os != 'windows-latest' }}
51+
- name: package
5352
run: |
54-
mkdir -p ${{ github.workspace }}/artifact
55-
cp ${{ github.workspace }}/target/${{ matrix.target }}/release/lua-language-server ${{ github.workspace }}/artifact/
56-
cp -r "${{ github.workspace }}/resources" "${{ github.workspace }}/artifact/"
57-
- name: package-windows
58-
if: ${{ matrix.os == 'windows-latest' }}
59-
run: |
60-
New-Item -ItemType Directory -Path "${{ github.workspace }}/artifact"
61-
Copy-Item -Path ${{ github.workspace }}\target\${{ matrix.target }}\release\lua-language-server.exe -Destination ${{ github.workspace }}\artifact\
62-
Copy-Item -Path ${{ github.workspace }}\resources -Destination ${{ github.workspace }}\artifact\ -Recurse
63-
shell: pwsh
53+
python publish/workflow_copy_files.py . "${{ github.workspace }}/artifact"
6454
- name: Upload
6555
uses: actions/upload-artifact@v3
6656
with:

crates/basic/src/parser/lua_syntax_tree.rs

-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ impl LuaSyntaxTree {
3030
}
3131

3232
impl LuaUserData for LuaSyntaxTree {
33-
fn add_fields<F: LuaUserDataFields<Self>>(fields: &mut F) {}
34-
3533
fn add_methods<M: LuaUserDataMethods<Self>>(methods: &mut M) {
3634
methods.add_method("getRoot", |_, this, ()| Ok(this.get_root()));
3735
// methods.add_method("get_chunk_node", |_, this, ()| Ok(this.get_chunk_node()));

publish/workflow_copy_files.py

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#! /usr/bin/env python3
2+
import os
3+
import shutil
4+
import argparse
5+
6+
parser = argparse.ArgumentParser(description='Copy specified directories from source to target.')
7+
parser.add_argument('source_dir', help='Source directory path')
8+
parser.add_argument('target_dir', help='Target directory path')
9+
args = parser.parse_args()
10+
11+
directories = ['locale', 'bin', 'meta', 'script']
12+
files = ['main.lua', "changelog.md", "LICENSE"]
13+
14+
if os.path.exists(args.target_dir):
15+
shutil.rmtree(args.target_dir)
16+
os.makedirs(args.target_dir)
17+
18+
def copy_directories(source_dir, target_dir, directories):
19+
if not os.path.exists(target_dir):
20+
os.makedirs(target_dir)
21+
for directory in directories:
22+
src_path = os.path.join(source_dir, directory)
23+
dst_path = os.path.join(target_dir, directory)
24+
if os.path.exists(src_path):
25+
shutil.copytree(src_path, dst_path)
26+
else:
27+
print(f"Directory {src_path} does not exist.")
28+
29+
copy_directories(args.source_dir, args.target_dir, directories)
30+
31+
def copy_files(source_dir, target_dir, files):
32+
for file in files:
33+
src_path = os.path.join(source_dir, file)
34+
dst_path = os.path.join(target_dir, file)
35+
if os.path.exists(src_path):
36+
shutil.copy2(src_path, dst_path)
37+
else:
38+
print(f"File {src_path} does not exist.")
39+
40+
copy_files(args.source_dir, args.target_dir, files)

0 commit comments

Comments
 (0)