feat: keep improving compile

This commit is contained in:
shenjack 2022-12-29 17:11:44 +08:00
parent 5c35698c98
commit 0f6e8eb327
4 changed files with 24 additions and 7 deletions

View File

@ -7,10 +7,10 @@
import os import os
import zipfile import zipfile
print(os.listdir('./build')) print(os.listdir('../../build'))
with zipfile.ZipFile('./build/main.zip', 'w', zipfile.ZIP_DEFLATED, compresslevel=9) as dist_zip: 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 path, sub_paths, sub_files in os.walk('../../build/DR.dist'):
print(f'writing {path}') print(f'writing {path}')
for file in sub_files: for file in sub_files:
file_path = os.path.join(path, file) file_path = os.path.join(path, file)

12
.github/workflows/get_info.py vendored Normal file
View File

@ -0,0 +1,12 @@
# -------------------------------
# Difficult Rocket
# Copyright © 2021-2022 by shenjackyuanjie 3695888@qq.com
# All rights reserved
# -------------------------------
import os
import sys
print(os.curdir)
print(sys.path)

View File

@ -58,6 +58,12 @@ jobs:
pip install -r requirement.txt pip install -r requirement.txt
pip install nuitka orderedset pip install nuitka orderedset
# 提取 DR 版本和其他信息
- name: Get Difficult-Rocket info
id: DR_info
shell: shell
run: python ./.github/workflows/get_info.py
# 还是得我自己写脚本 # 还是得我自己写脚本
- name: Build on Windows - name: Build on Windows
if: runner.os == 'Windows' if: runner.os == 'Windows'
@ -65,8 +71,6 @@ jobs:
run: | run: |
$arg = @() $arg = @()
$arg += @("--standalone") $arg += @("--standalone")
$arg += @("--assume-yes-for-download")
$arg += @("--show-progress")
$arg += @("--msvc=latest") $arg += @("--msvc=latest")
$arg += @("--clang") $arg += @("--clang")
$arg += @("--lto=no") $arg += @("--lto=no")
@ -76,6 +80,8 @@ jobs:
$arg += @("--include-data-dir=./libs/fonts=./libs/fonts") $arg += @("--include-data-dir=./libs/fonts=./libs/fonts")
$arg += @("--include-data-dir=./textures=./textures") $arg += @("--include-data-dir=./textures=./textures")
$arg += @("--include-data-dir=./configs=./configs") $arg += @("--include-data-dir=./configs=./configs")
$arg += @("--show-progress")
$arg += @("--assume-yes-for-download")
python -m nuitka $arg DR.py python -m nuitka $arg DR.py
- name: Build on MacOS / Linux - name: Build on MacOS / Linux
@ -92,12 +98,12 @@ jobs:
python -m nuitka $arg DR.py python -m nuitka $arg DR.py
- name: after build - name: after build
run: python after_compile.py run: python ./.github/workflows/after_compile.py
# Uploads artifact # Uploads artifact
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: ${{ runner.os }}-${{ matrix.python-version }}-Build.${{ github.run_number}}+${{ steps.get_short_sha.outputs.short_sha }} name: Difficult-Rocket-${{ runner.os }}-${{ matrix.python-version }}-Build.${{ github.run_number}}+${{ steps.get_short_sha.outputs.short_sha }}
path: | path: |
build/*.zip build/*.zip

View File

@ -1 +0,0 @@
viztracer --output_file ./logs/viz_result.json --open --tracer_entries 10000000 DR.py