From fb37486223421673b0640d42d19f5f4610cde493 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Mon, 2 Jan 2023 19:22:22 +0800 Subject: [PATCH] feat: try pwsh in Linux Macos CI --- .github/workflows/nuitka.yml | 71 ++++++++++++++++++++++++++++-------- nuitka1-complie.ps1 | 29 ++++++++++++++- nuitka3-complie.ps1 | 29 ++++++++++++++- 3 files changed, 112 insertions(+), 17 deletions(-) diff --git a/.github/workflows/nuitka.yml b/.github/workflows/nuitka.yml index 4a4e148..fede677 100644 --- a/.github/workflows/nuitka.yml +++ b/.github/workflows/nuitka.yml @@ -55,7 +55,7 @@ jobs: - name: Install env run: | pip install -r requirement.txt - pip install nuitka==1.3.4 orderedset + pip install nuitka orderedset==2.0.2 # 提取 DR 版本和其他信息 - name: Display Difficult-Rocket info @@ -71,37 +71,78 @@ jobs: if: runner.os == 'Windows' shell: pwsh run: | - Write-Output $GITHUB_OUTPUT - Write-Output $`{GITHUB_OUTPUT`} $arg = @() + # 输出配置 $arg += @("--standalone") + $arg += @("--output-dir=build") + $arg += @("--company-name=tool-shenjack-workshop") + $arg += @("--product-name=Difficult-Rocket") + $arg += @("--product-version=$env:DR_version") + $arg += @("--file-description=Difficult-Rocket!") + $arg += @("--file-version=0.0.0.1") + # 编译器配置 $arg += @("--msvc=latest") $arg += @("--clang") $arg += @("--lto=no") - $arg += @("--output-dir=build") - $arg += @("--nofollow-import-to=objprint,numpy,pillow,cffi,PIL,pyglet") + # 包配置 + $arg += @("--nofollow-import-to=objprint,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") + # 编译配置 # $arg += @("--show-progress") $arg += @("--assume-yes-for-download") python -m nuitka $arg DR.py - Write-Output $GITHUB_OUTPUT - name: Build on MacOS / Linux if: ${{ runner.os == 'macOS' || runner.os == 'Linux' }} - shell: bash + shell: pwsh run: | - arg="--standalone --assume-yes-for-download --output-dir=build " - # arg+="--show-progress " - 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" + $arg = @() + # 输出配置 + $arg += @("--standalone") + $arg += @("--output-dir=build") + $arg += @("--company-name=tool-shenjack-workshop") + $arg += @("--product-name=Difficult-Rocket") + $arg += @("--product-version=$env:DR_version") + $arg += @("--file-version=0.0.0.1") + $arg += @("--file-description=Difficult-Rocket!") + # 编译器配置 + $arg += @("--clang") + $arg += @("--lto=no") + # 包配置 + $arg += @("--nofollow-import-to=objprint,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") + # 编译配置 + # $arg += @("--show-progress") + $arg += @("--assume-yes-for-download") python -m nuitka $arg DR.py + + + # # 输出配置 + # arg="--standalone " + # arg+="--output-dir=build " + # + # # 编译器配置 + # arg+="--clang " + # arg+="--lto=no " + # # 包配置 + # arg+="--nofollow-import-to=objprint,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" + # # 编译配置 + # # arg+="--show-progress " + # arg+="--assume-yes-for-download " + # python -m nuitka $arg DR.py - name: after build shell: pwsh diff --git a/nuitka1-complie.ps1 b/nuitka1-complie.ps1 index 84e5a80..3b0463e 100644 --- a/nuitka1-complie.ps1 +++ b/nuitka1-complie.ps1 @@ -1,6 +1,33 @@ $start_time = Get-Uptime Write-Output $start_time -python3.8.exe -m nuitka --jobs=24 --clang --lto=no --mingw64 --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 + +$arg = @() +# 输出配置 +$arg += @("--standalone") +$arg += @("--output-dir=build/nuitka") +$arg += @("--company-name=tool-shenjack-workshop") +$arg += @("--product-name=Difficult-Rocket") +$arg += @("--product-version=0.6.4") +$arg += @("--file-version=0.0.0.1") +$arg += @("--file-description=Difficult-Rocket!") +# 编译器配置 +$arg += @("--mingw64") +$arg += @("--clang") +$arg += @("--lto=no") +# 包配置 +$arg += @("--nofollow-import-to=objprint,pillow,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") +# 编译配置 +$arg += @("--jobs=24") +$arg += @("--show-memory") +$arg += @("--show-progress") +$arg += @("--assume-yes-for-download") +python3.8.exe -m nuitka $arg $args DR.py + $end_time = Get-Uptime $out = $end_time.TotalMilliseconds - $start_time.TotalMilliseconds Write-Output $end_time.TotalSeconds $start_time.TotalSeconds $out s diff --git a/nuitka3-complie.ps1 b/nuitka3-complie.ps1 index f7383eb..e6db7dc 100644 --- a/nuitka3-complie.ps1 +++ b/nuitka3-complie.ps1 @@ -1,6 +1,33 @@ $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 --nofollow-import-to=objprint,numpy,pillow,cffi,PIL,pyglet --standalone $args .\DR.py + +$arg = @() +# 输出配置 +$arg += @("--standalone") +$arg += @("--output-dir=build/nuitka1") +$arg += @("--company-name=tool-shenjack-workshop") +$arg += @("--product-name=Difficult-Rocket") +$arg += @("--product-version=0.6.4") +$arg += @("--file-version=0.0.0.1") +$arg += @("--file-description=Difficult-Rocket!") +# 编译器配置 +$arg += @("--msvc=latest") +$arg += @("--clang") +$arg += @("--lto=no") +# 包配置 +$arg += @("--nofollow-import-to=objprint,pillow,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") +# 编译配置 +$arg += @("--jobs=24") +$arg += @("--show-memory") +$arg += @("--show-progress") +$arg += @("--assume-yes-for-download") +python3.8.exe -m nuitka $arg $args DR.py + $end_time = Get-Uptime $out = $end_time.TotalMilliseconds - $start_time.TotalMilliseconds Write-Output $end_time.TotalSeconds $start_time.TotalSeconds $out s