From 96ee0be7b6a71a563f6aacdbbd8b4812194bdbbb Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Thu, 29 Dec 2022 12:08:08 +0800 Subject: [PATCH] feat: try zip file --- .github/workflows/nuitka.yml | 14 +++++++------- after_compile.py | 9 +++++++++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/nuitka.yml b/.github/workflows/nuitka.yml index 4329a96..28f7967 100644 --- a/.github/workflows/nuitka.yml +++ b/.github/workflows/nuitka.yml @@ -84,10 +84,10 @@ jobs: run: python after_compile.py -# # Uploads artifact -# - name: Upload Artifact -# uses: actions/upload-artifact@v3 -# with: -# name: ${{ runner.os }} Build -# path: | -# build/*.zip \ No newline at end of file + # Uploads artifact + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ runner.os }} Build + path: | + build/*.zip \ No newline at end of file diff --git a/after_compile.py b/after_compile.py index 9767ee3..edc5a72 100644 --- a/after_compile.py +++ b/after_compile.py @@ -5,4 +5,13 @@ # ------------------------------- import os +import zipfile + print(os.listdir('./build')) + +with zipfile.ZipFile('./build/main.zip', 'w', zipfile.ZIP_DEFLATED, compresslevel=9) as dist_zip: + for path, sub_paths, sub_files in os.walk('./build/DR.dist'): + for file in sub_files: + file_path = os.path.join(path, file) + dist_zip.write(file_path) +