diff --git a/.github/workflows/build-multiplatform.yml b/.github/workflows/build-multiplatform.yml index ef13885..1abc453 100644 --- a/.github/workflows/build-multiplatform.yml +++ b/.github/workflows/build-multiplatform.yml @@ -31,12 +31,27 @@ jobs: pip install -r requirements.txt - name: Build engine and bootstrapper run: | - python build.py + python build.py --no-zip + - name: Decode PFX certificate + run: | + echo "${{ secrets.CODESIGN_PFX }}" | Out-File -Encoding ascii -FilePath cert_base64.txt + certutil -decode cert_base64.txt cert.pfx + shell: pwsh + - name: Sign engine.exe y bootstrapper.exe + run: | + & "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /f cert.pfx /p "${{ secrets.VNE_KEY }}" /tr http://timestamp.digicert.com /td sha256 /fd sha256 dist/engine.exe + & "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /f cert.pfx /p "${{ secrets.VNE_KEY }}" /tr http://timestamp.digicert.com /td sha256 /fd sha256 dist/lib/bootstrapper.exe + shell: pwsh - name: Upload Artifacts uses: actions/upload-artifact@v4 with: name: dist-windows - path: dist/vne-win.zip + path: dist + - name: delete cert files + run: | + del cert.pfx + del cert_base64.txt + shell: pwsh build-linux: runs-on: ubuntu-22.04 @@ -59,11 +74,12 @@ jobs: - name: Build engine and bootstrapper run: | python build.py + # incluye el firmado aqui de engine.exe y /lib/bootstrapper.exe - name: Upload Artifacts uses: actions/upload-artifact@v4 with: name: dist-linux - path: dist/vne-linux.zip + path: dist # Temporarily disabled # build-mac: diff --git a/build.py b/build.py index afa04ef..12be683 100644 --- a/build.py +++ b/build.py @@ -64,6 +64,12 @@ def so_name(): sys.exit(1) def build_engine(): + no_zip = False + for arg in sys.argv[1:]: + if arg == "--no-zip": + no_zip = True + break + # Verify that main.py exists in the current directory. if not os.path.exists("main.py"): print("[build.py] Error: main.py was not found in the current directory.") @@ -87,18 +93,21 @@ def build_engine(): subprocess.check_call(doc) print("[build.py] The documentation was correctly constructed") - 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') + if not no_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) else: - print(f"[build.py] Error: Unsupported platform '{platform.system()}'. Cannot zip engine and documentation.") - sys.exit(1) + print("[build.py] Skipping zipping of engine and documentation as per --no-zip flag.") except subprocess.CalledProcessError as e: print(f"[build.py] Error during compilation: {e}") sys.exit(1)