Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
814ea15
build(deps): create setup.py
neyunse Aug 3, 2025
edbb577
build(deps): update build.py and setup.py
neyunse Aug 3, 2025
66ccb2e
create 1 file and delete 1 file
neyunse Aug 3, 2025
17b343e
ci: update build-multiplatform.yml
neyunse Aug 3, 2025
cb3db06
update build-multiplatform.yml, bootstrapper.spec and engine.spec
neyunse Aug 3, 2025
0db0478
update bootstrapper.spec and engine.spec
neyunse Aug 3, 2025
18a6fb0
ci: update build-multiplatform.yml
neyunse Aug 3, 2025
eb5b0bc
update bootstrapper.spec, build.py and engine.spec
neyunse Aug 3, 2025
6e0f6d1
ci: update build-multiplatform.yml
neyunse Aug 3, 2025
9ef868a
update bootstrapper.spec, build.py, engine.spec and main.py
neyunse Aug 3, 2025
764e8aa
ci: update build-multiplatform.yml
neyunse Aug 3, 2025
9bbc1f1
ci: update build-multiplatform.yml
neyunse Aug 3, 2025
e8ec6c0
chore: update .gitignore
neyunse Aug 3, 2025
352302d
ci: update build-multiplatform.yml
neyunse Aug 3, 2025
4bbd6e9
update build-multiplatform.yml, bootstrapper.spec, build.py and engin…
neyunse Aug 4, 2025
c5bee96
update build-multiplatform.yml, build.py and _version.py update build…
neyunse Aug 4, 2025
074b263
ci: update build-multiplatform.yml
neyunse Aug 4, 2025
5468fe0
ci: update build-multiplatform.yml and docs.yml
neyunse Aug 4, 2025
68f547f
ci: update build-multiplatform.yml
neyunse Aug 4, 2025
f10b55b
Update build.py
neyunse Aug 4, 2025
f3f20e3
Update .github/workflows/build-multiplatform.yml
neyunse Aug 4, 2025
6fbfffe
Update .github/workflows/build-multiplatform.yml
neyunse Aug 4, 2025
d37f239
Update .github/workflows/build-multiplatform.yml
neyunse Aug 4, 2025
810729d
Merge pull request #18 from UnSetSoft/gh/neyunse/test
neyunse Aug 4, 2025
601e228
ci: update build-multiplatform.yml
neyunse Aug 4, 2025
52024e1
Update main.py
neyunse Aug 4, 2025
43b999b
Update .github/workflows/build-multiplatform.yml
neyunse Aug 4, 2025
b28c2f2
Update .github/workflows/build-multiplatform.yml
neyunse Aug 4, 2025
14fb1a0
update build.py and main.py
neyunse Aug 4, 2025
2ee2e8e
Merge branch 'gh/neyunse/dev' of https://github.com/Neyunse/vne into …
neyunse Aug 4, 2025
a6692d2
ci: update build-multiplatform.yml
neyunse Aug 4, 2025
ebfb42e
ci: update build-multiplatform.yml
neyunse Aug 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 124 additions & 0 deletions .github/workflows/build-multiplatform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: Build Multiplatform Engine

on:
push:
branches: [dev]
pull_request:
branches: [dev]
types: [closed]

permissions:
contents: write
id-token: write


jobs:
build-windows:
if: github.event.pull_request.merged == true
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Generate env.py with VNE_KEY
run: |
echo "import os" >> ./vne/env.py
echo "os.environ['VNE_KEY'] = '${{ secrets.VNE_KEY }}'" >> ./vne/env.py
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build engine and bootstrapper
run: |
python build.py
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: dist-windows
path: dist/vne-win.zip

build-linux:
runs-on: ubuntu-22.04
needs: build-windows
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Generate env.py with VNE_KEY
run: |
echo "import os" >> ./vne/env.py
echo "os.environ['VNE_KEY'] = '${{ secrets.VNE_KEY }}'" >> ./vne/env.py
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build engine and bootstrapper
run: |
python build.py
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: dist-linux
path: dist/vne-linux.zip

# Temporarily disabled
# build-mac:
# runs-on: macos-14
# needs: build-linux
# steps:
# - uses: actions/checkout@v3
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: "3.10"
# - name: Generate env.py with VNE_KEY
# run: |
# echo "import os" >> ./vne/env.py
# echo "os.environ['VNE_KEY'] = '${{ secrets.VNE_KEY }}'" >> ./vne/env.py
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r requirements.txt
# - name: Build engine and bootstrapper
# run: |
# python build.py
# - name: Upload Artifacts
# uses: actions/upload-artifact@v4
# with:
# name: dist-mac
# path: dist/vne-darwin.zip

create-release:
runs-on: ubuntu-22.04
needs: [build-windows, build-linux]
steps:
- uses: actions/checkout@v3
- name: Extract engine version
id: get_version
run: |
VERSION=$(python -c "import re; f=open('vne/_version.py').read(); print(re.search(r'__version__\s*=\s*[\'\"]([^\'\"]+)[\'\"]', f).group(1))")
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.get_version.outputs.version }}
name: ${{ steps.get_version.outputs.version }}
body: "Automatic release generated by CI. Important information, the engine is detected by the antivirus and removes the executables. This is because all the libraries are integrated into a single executable and also these executables are not signed. Some distributions such as Linux were not tested!"
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Upload artifacts to the release
run: |
for file in ./artifacts/*/*; do
gh release upload "${{ steps.get_version.outputs.version }}" "$file" --repo "$GITHUB_REPOSITORY"
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
- '_version.py'

workflow_dispatch:
release:
types: [published] # Triggered when a release is published (not draft)

permissions:
contents: read
Expand Down
18 changes: 9 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ build
dist
.venv
__pycache__
*.png
*.jpg
*.mp3
*.mp4
*.ogg
*.sav
projects/**/*.png
projects/**/*.jpg
projects/**/*.mp3
projects/**/*.mp4
projects/**/*.ogg
projects/**/*.sav
compile_sdk.py
build_sdk.py
engine.onefile-build
Expand All @@ -25,9 +25,9 @@ build
traceback.txt
log.txt
docs
*.wav
*.mp3
*.ogg
projects/**/*.wav
projects/**/*.mp3
projects/**/*.ogg
engine-error.txt
env.py
*.vsix
Expand Down
5 changes: 3 additions & 2 deletions bootstrapper.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- mode: python ; coding: utf-8 -*-

import os
env_hook = os.path.abspath("env.py")

a = Analysis(
['bootstrapper.py'],
Expand Down Expand Up @@ -27,7 +28,7 @@ exe = EXE(
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx=False,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
Expand Down
33 changes: 28 additions & 5 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import sys
import subprocess
import zipfile
import platform

def zip_folders_and_files(folders, files, zip_path):
with zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DEFLATED) as zipf:
Expand All @@ -22,13 +23,13 @@ def zip_folders_and_files(folders, files, zip_path):
if file_path and os.path.isfile(file_path):
zipf.write(file_path, os.path.basename(file_path))

def build(spec="engine"):
def build(spec="engine", so="win"):
if spec == "bootstrapper":
return [
"pyinstaller",
"--clean",
"--distpath",
"./dist/lib/win",
f"./dist/lib/{so}",
"--workpath",
"./build",
f"{spec}.spec"
Expand All @@ -51,6 +52,17 @@ def buildDoc():
"./dist/docs"
]

def so_name():
if platform.system() == "Windows":
return "win"
elif platform.system() == "Linux":
return "linux"
elif platform.system() == "Darwin":
return "darwin"
else:
print(f"[build.py] Error: Unsupported platform '{platform.system()}'. Cannot determine shared object name.")
sys.exit(1)

def build_engine():
# Verify that main.py exists in the current directory.
if not os.path.exists("main.py"):
Expand All @@ -59,7 +71,7 @@ def build_engine():

try:
engine = build()
bootstrapper = build("bootstrapper")
bootstrapper = build("bootstrapper", so=so_name())
doc = buildDoc()


Expand All @@ -75,10 +87,21 @@ def build_engine():
subprocess.check_call(doc)
print("[build.py] The documentation was correctly constructed")

zip_folders_and_files(['./dist/lib', './dist/docs'], ['./dist/engine.exe'], './dist/vne.zip')
if platform.system() == "Windows":
print("[build.py] Zipping the engine and documentation...")
zip_folders_and_files(['./dist/lib', './dist/docs'], ['./dist/engine.exe'], f'./dist/vne-win.zip')
elif platform.system() == "Linux":
print("[build.py] Zipping the engine and documentation for Linux...")
zip_folders_and_files(['./dist/lib', './dist/docs'], ['./dist/engine'], f'./dist/vne-linux.zip')
elif platform.system() == "Darwin":
print("[build.py] Zipping the engine and documentation for macOS...")
zip_folders_and_files(['./dist/lib', './dist/docs'], ['./dist/engine'], f'./dist/vne-darwin.zip')
else:
print(f"[build.py] Error: Unsupported platform '{platform.system()}'. Cannot zip engine and documentation.")
sys.exit(1)
except subprocess.CalledProcessError as e:
print(f"[build.py] Error during compilation: {e}")
sys.exit(1)

if __name__ == "__main__":
build_engine()
build_engine()
3 changes: 1 addition & 2 deletions engine.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- mode: python ; coding: utf-8 -*-


a = Analysis(
['main.py'],
pathex=[],
Expand All @@ -27,7 +26,7 @@ exe = EXE(
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx=False,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
Expand Down
22 changes: 21 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,30 @@ def distribute_game(game_path):

os.unlink(pkg_path)

exe_source = os.path.join(os.path.dirname(sys.executable),"lib", "win", "bootstrapper.exe")
exe_source = None

if platform.system() == "Windows":
exe_source = os.path.join(os.path.dirname(sys.executable), "lib", "win", "bootstrapper.exe")
elif platform.system() == "Linux":
exe_source = os.path.join(os.path.dirname(sys.executable), "lib", "linux", "bootstrapper")
elif platform.system() == "Darwin":
exe_source = os.path.join(os.path.dirname(sys.executable), "lib", "darwin", "bootstrapper")
else:
raise Exception("Unsupported platform")

exe_source = os.path.abspath(exe_source)

exe_dest = os.path.join(dest_folder, "game.exe")

if platform.system() == "Windows":
exe_dest = os.path.join(dest_folder, "game.exe")
elif platform.system() == "Linux":
exe_dest = os.path.join(dest_folder, "game")
elif platform.system() == "Darwin":
exe_dest = os.path.join(dest_folder, "game.app", "Contents", "MacOS", "game")
os.makedirs(os.path.dirname(exe_dest), exist_ok=True)


shutil.copy2(exe_source, exe_dest)
print(f"[distribute] Binary copied: {exe_source} → {exe_dest}")

Expand Down
Binary file added sdk_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion vne/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "v1.0.0-alpha.12"
__version__ = "v1.0.0-alpha.13"
Loading