Skip to content

Commit

Permalink
test build
Browse files Browse the repository at this point in the history
  • Loading branch information
CppCXY committed Oct 31, 2024
1 parent b3fc3cc commit f226339
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 14 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,9 @@ jobs:
cargo install cross
cross build --release --target ${{ matrix.target }} --features no_format -p luals
- name: package-unix
if: ${{ matrix.os != 'windows-latest' }}
- name: package
run: |
mkdir -p ${{ github.workspace }}/artifact
cp ${{ github.workspace }}/target/${{ matrix.target }}/release/lua-language-server ${{ github.workspace }}/artifact/
cp -r "${{ github.workspace }}/resources" "${{ github.workspace }}/artifact/"
- name: package-windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
New-Item -ItemType Directory -Path "${{ github.workspace }}/artifact"
Copy-Item -Path ${{ github.workspace }}\target\${{ matrix.target }}\release\lua-language-server.exe -Destination ${{ github.workspace }}\artifact\
Copy-Item -Path ${{ github.workspace }}\resources -Destination ${{ github.workspace }}\artifact\ -Recurse
shell: pwsh
python publish/workflow_copy_files.py . "${{ github.workspace }}/artifact"
- name: Upload
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 0 additions & 2 deletions crates/basic/src/parser/lua_syntax_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ impl LuaSyntaxTree {
}

impl LuaUserData for LuaSyntaxTree {
fn add_fields<F: LuaUserDataFields<Self>>(fields: &mut F) {}

fn add_methods<M: LuaUserDataMethods<Self>>(methods: &mut M) {
methods.add_method("getRoot", |_, this, ()| Ok(this.get_root()));
// methods.add_method("get_chunk_node", |_, this, ()| Ok(this.get_chunk_node()));
Expand Down
40 changes: 40 additions & 0 deletions publish/workflow_copy_files.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#! /usr/bin/env python3
import os
import shutil
import argparse

parser = argparse.ArgumentParser(description='Copy specified directories from source to target.')
parser.add_argument('source_dir', help='Source directory path')
parser.add_argument('target_dir', help='Target directory path')
args = parser.parse_args()

directories = ['locale', 'bin', 'meta', 'script']
files = ['main.lua', "changelog.md", "LICENSE"]

if os.path.exists(args.target_dir):
shutil.rmtree(args.target_dir)
os.makedirs(args.target_dir)

def copy_directories(source_dir, target_dir, directories):
if not os.path.exists(target_dir):
os.makedirs(target_dir)
for directory in directories:
src_path = os.path.join(source_dir, directory)
dst_path = os.path.join(target_dir, directory)
if os.path.exists(src_path):
shutil.copytree(src_path, dst_path)
else:
print(f"Directory {src_path} does not exist.")

copy_directories(args.source_dir, args.target_dir, directories)

def copy_files(source_dir, target_dir, files):
for file in files:
src_path = os.path.join(source_dir, file)
dst_path = os.path.join(target_dir, file)
if os.path.exists(src_path):
shutil.copy2(src_path, dst_path)
else:
print(f"File {src_path} does not exist.")

copy_files(args.source_dir, args.target_dir, files)

0 comments on commit f226339

Please sign in to comment.