From ac1960ea2784aebfc4b97e1bde68a7d25375fe1b Mon Sep 17 00:00:00 2001 From: ValKmjolnir Date: Sun, 12 May 2024 11:51:28 +0800 Subject: [PATCH] :memo: adjust CI --- .github/workflows/c-cpp.yml | 19 +++++++++---------- tools/pack.py | 8 ++++++-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 33a290b..65a76a5 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -1,4 +1,4 @@ -name: C/C++ CI +name: Nasal Interpreter Build/Test/Package CI on: schedule: @@ -20,9 +20,10 @@ jobs: cd module make all -j4 cd .. - make test - tar -czf nasal-mac-nightly.tgz . - python3 tools/pack.py + - name: test + run: make test + - name: package + run: python3 tools/pack.py - name: Release file # You may pin to the exact commit or the version. # uses: djnicholson/release-action@e9a535b3eced09c460e07a84118fb74ae9b53236 @@ -36,7 +37,6 @@ jobs: automatic_release_tag: next_macOS # File to release files: | - nasal-mac-nightly.tgz nasal-Darwin.tar linux-x86_64-build: @@ -49,10 +49,10 @@ jobs: cd module make all -j4 cd .. - make test - touch nasal-linux-x86_64-nightly.tgz - tar -czf nasal-linux-x86_64-nightly.tgz --exclude=nasal-linux-x86_64-nightly.tgz . - python3 tools/pack.py + - name: test + run: make test + - name: package + run: python3 tools/pack.py - name: Release file # You may pin to the exact commit or the version. # uses: djnicholson/release-action@e9a535b3eced09c460e07a84118fb74ae9b53236 @@ -66,6 +66,5 @@ jobs: automatic_release_tag: next_linux_x86_64 # File to release files: | - nasal-linux-x86_64-nightly.tgz nasal-Linux.tar diff --git a/tools/pack.py b/tools/pack.py index 7fddd11..63aa477 100644 --- a/tools/pack.py +++ b/tools/pack.py @@ -4,8 +4,7 @@ import os import platform import shutil - -nasal_version = "11.1" +nasal_version = "11.2" build_directory = pathlib.Path("build") if not os.path.exists(build_directory): @@ -47,20 +46,25 @@ for m in ["libfib", "libkey", "libmat", "libnasock"]: tar_file_name = "nasal-{}".format(platform.system()) + # create package directory in build directory and copy files needed package_directory = build_directory.joinpath(tar_file_name) if not os.path.exists(package_directory): os.mkdir(package_directory) os.mkdir(package_directory.joinpath("module")) + print("pack nasal executable") shutil.copy(nasal_executable, package_directory.joinpath(nasal_executable)) + print("pack nasal standard library") shutil.copytree(nasal_standard_library, package_directory.joinpath(nasal_standard_library)) + for m in nasal_modules: print("pack nasal module:", m) shutil.copy(m, package_directory.joinpath(m)) file = tarfile.open(name=tar_file_name + ".tar", mode="w") file.add(package_directory) + print("pack succeeded") file.close()