feat: try some script

This commit is contained in:
shenjack 2022-12-29 11:15:00 +08:00
parent f639584f46
commit ff15d5ae98
3 changed files with 60 additions and 18 deletions

View File

@ -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/**/*
# # Uploads artifact
# - name: Upload Artifact
# uses: actions/upload-artifact@v3
# with:
# name: ${{ runner.os }} Build
# path: |
# build/*.exe
# build/*.bin
# build/*.app/**/*

8
after_compile.py Normal file
View File

@ -0,0 +1,8 @@
# -------------------------------
# Difficult Rocket
# Copyright © 2021-2022 by shenjackyuanjie 3695888@qq.com
# All rights reserved
# -------------------------------
import os
print(os.listdir('./build'))

View File

@ -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