diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 58c2c5a..7ed3ef1 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -4,7 +4,7 @@ on: schedule: - cron: "0 16 * * *" push: - branches: [ master,develop ] + branches: [ master, develop ] pull_request: branches: [ master ] workflow_dispatch: @@ -22,6 +22,7 @@ jobs: cd .. make test tar -czf nasal-mac-nightly.tgz . + python3 tools/pack.py - name: Release file # You may pin to the exact commit or the version. # uses: djnicholson/release-action@e9a535b3eced09c460e07a84118fb74ae9b53236 @@ -34,7 +35,7 @@ jobs: # Name of the tag for the release (will be associated with current branch) automatic_release_tag: next_macOS # File to release - files: nasal-mac-nightly.tgz + files: [nasal-mac-nightly.tgz, nasal-Darwin.tar] linux-x86_64-build: runs-on: ubuntu-latest @@ -48,7 +49,8 @@ jobs: 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 . + tar -czf nasal-linux-x86_64-nightly.tgz --exclude=nasal-linux-x86_64-nightly.tgz . + python3 tools/pack.py - name: Release file # You may pin to the exact commit or the version. # uses: djnicholson/release-action@e9a535b3eced09c460e07a84118fb74ae9b53236 @@ -61,5 +63,5 @@ jobs: # Name of the tag for the release (will be associated with current branch) automatic_release_tag: next_linux_x86_64 # File to release - files: nasal-linux-x86_64-nightly.tgz + files: [nasal-linux-x86_64-nightly.tgz, nasal-Linux.tar] diff --git a/tools/pack.py b/tools/pack.py index 4a94e7a..7fddd11 100644 --- a/tools/pack.py +++ b/tools/pack.py @@ -4,8 +4,14 @@ import os import platform import shutil + nasal_version = "11.1" +build_directory = pathlib.Path("build") +if not os.path.exists(build_directory): + print("pack binaries failed: build directory not found") + exit(-1) + nasal_executable = pathlib.Path("nasal") nasal_standard_library = pathlib.Path("std") if not os.path.exists(nasal_executable): @@ -15,7 +21,7 @@ if not os.path.exists(nasal_standard_library): print("pack binaries failed: nasal standard library not found") exit(-1) -nasal_module_directory = pathlib.Path("./module") +nasal_module_directory = pathlib.Path("module") if not os.path.exists(nasal_module_directory): print("pack binaries failed: nasal module directory not found") exit(-1) @@ -40,8 +46,9 @@ for m in ["libfib", "libkey", "libmat", "libnasock"]: nasal_modules.append(lib) -tar_file_name = "./nasal-{}-{}".format(platform.system(), nasal_version) -package_directory = pathlib.Path(tar_file_name) +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"))