diff --git a/.github/workflows/nuitka.yml b/.github/workflows/nuitka.yml index 988d222..b9f4626 100644 --- a/.github/workflows/nuitka.yml +++ b/.github/workflows/nuitka.yml @@ -26,6 +26,7 @@ jobs: - name: Check out uses: actions/checkout@v3 + # 安装 Python - name: Setup Python uses: actions/setup-python@v4 with: @@ -39,22 +40,55 @@ jobs: run: pip install -r requirement.txt - # Build python script into a stand-alone exe - - name: Build - uses: Nuitka/Nuitka-Action@v0.4 - with: - script-name: DR.py - standalone: true - include-package-data: './configs=./configs' - assume-yes-for-download: true +# # Build python script into a stand-alone exe +# - name: Build +# uses: Nuitka/Nuitka-Action@v0.4 +# with: +# script-name: DR.py +# standalone: true +# onefile: false +## include-package-data: './configs=./configs' +# assume-yes-for-download: true + + # 还是得我自己写脚本 + - name: Build on Windows + if: runner.os == 'Windows' + shell: powershell + run: | + $arg = "--standalone --assume-yes-for-download " + $arg += "--msvc=latest --clang --lto=no " + $arg += "--nofollow-import-to=objprint,numpy,pillow,cffi,PIL,pyglet " + $arg += "--include-data-dir=./libs/pyglet=./pyglet " + $arg += "--include-data-dir=./libs/fonts=./libs/fonts " + $arg += "--include-data-dir=./textures=./textures " + $arg += "--include-data-dir=./configs=./configs " + python -m nuitka $arg DR.py + + - name: Build on MacOS / Linux + if: ${{ runner.os == 'macOS' || runner.os == 'Linux' }} + shell: bash + run: | + arg = "--standalone --assume-yes-for-download " + arg += "--clang --lto=no " + arg += "--nofollow-import-to=objprint,numpy,pillow,cffi,PIL,pyglet " + arg += "--include-data-dir=./libs/pyglet=./pyglet " + arg += "--include-data-dir=./libs/fonts=./libs/fonts " + arg += "--include-data-dir=./textures=./textures " + arg += "--include-data-dir=./configs=./configs " + python -m nuitka $arg DR.py + + - name: after build + shell: powershell7 + run: | + python after_compile.py - # Uploads artifact - - name: Upload Artifact - uses: actions/upload-artifact@v3 - with: - name: ${{ runner.os }} Build - path: | - build/*.exe - build/*.bin - build/*.app/**/* \ No newline at end of file +# # Uploads artifact +# - name: Upload Artifact +# uses: actions/upload-artifact@v3 +# with: +# name: ${{ runner.os }} Build +# path: | +# build/*.exe +# build/*.bin +# build/*.app/**/* \ No newline at end of file diff --git a/after_compile.py b/after_compile.py new file mode 100644 index 0000000..9767ee3 --- /dev/null +++ b/after_compile.py @@ -0,0 +1,8 @@ +# ------------------------------- +# Difficult Rocket +# Copyright © 2021-2022 by shenjackyuanjie 3695888@qq.com +# All rights reserved +# ------------------------------- + +import os +print(os.listdir('./build')) diff --git a/nuitka3-complie.ps1 b/nuitka3-complie.ps1 index 04c5a96..f7383eb 100644 --- a/nuitka3-complie.ps1 +++ b/nuitka3-complie.ps1 @@ -1,6 +1,6 @@ $start_time = Get-Uptime Write-Output $start_time -python3.8.exe -m nuitka --jobs=24 --msvc=latest --clang --lto=no --show-memory --show-progress --output-dir=build/nuitka1 --include-data-dir=./configs=./configs --include-data-dir=./libs/fonts=./libs/fonts --include-data-dir=./textures=./textures --include-data-dir=./libs/pyglet=./pyglet --enable-plugin=numpy --nofollow-import-to=objprint,numpy,pillow,cffi,PIL,pyglet --standalone $args .\DR.py +python3.8.exe -m nuitka --jobs=24 --msvc=latest --clang --lto=no --show-memory --show-progress --output-dir=build/nuitka1 --include-data-dir=./configs=./configs --include-data-dir=./libs/fonts=./libs/fonts --include-data-dir=./textures=./textures --include-data-dir=./libs/pyglet=./pyglet --nofollow-import-to=objprint,numpy,pillow,cffi,PIL,pyglet --standalone $args .\DR.py $end_time = Get-Uptime $out = $end_time.TotalMilliseconds - $start_time.TotalMilliseconds Write-Output $end_time.TotalSeconds $start_time.TotalSeconds $out s