From a85596d1df20bb861373c601e553b547ab371781 Mon Sep 17 00:00:00 2001 From: Decapitated Date: Sat, 8 Mar 2025 01:13:52 -0600 Subject: [PATCH 1/2] scons env.Install works better than Copy. --- SConstruct | 46 ++++++++++++++------------- demo/addons/gdhtml/gdhtml.gdextension | 20 ++++++------ 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/SConstruct b/SConstruct index 537339f..86ab7f2 100644 --- a/SConstruct +++ b/SConstruct @@ -77,44 +77,46 @@ library = env.SharedLibrary( copy = env.InstallAs("{}/addons/{}/bin/{}/{}/{}{}".format(projectdir, libname, env["platform"], env["arch"], filepath, file), library) -default_args = [library, copy] -Default(*default_args) +copy_libraries = None if env["platform"] == "windows": - Execute(Copy( - f"{projectdir}/addons/{libname}/bin/windows/", - [ - "ultralight/bin/windows/AppCore.dll", - "ultralight/bin/windows/Ultralight.dll", - "ultralight/bin/windows/UltralightCore.dll", - "ultralight/bin/windows/WebCore.dll" + copy_libraries = env.Install( + f"{projectdir}/addons/{libname}/bin/windows/{env["arch"]}", + source = [ + f"ultralight/bin/windows/AppCore.dll", + f"ultralight/bin/windows/Ultralight.dll", + f"ultralight/bin/windows/UltralightCore.dll", + f"ultralight/bin/windows/WebCore.dll" ] - )) + ) elif env["platform"] == "linux": - Execute(Copy( - f"{projectdir}/addons/{libname}/bin/linux/{env["arch"]}/", - [ + copy_libraries = env.Install( + f"{projectdir}/addons/{libname}/bin/linux/{env["arch"]}", + source = [ f"ultralight/bin/linux/{env["arch"]}/libAppCore.so", f"ultralight/bin/linux/{env["arch"]}/libUltralight.so", f"ultralight/bin/linux/{env["arch"]}/libUltralightCore.so", f"ultralight/bin/linux/{env["arch"]}/libWebCore.so" ] - )) + ) elif env["platform"] == "macos": - Execute(Copy( - f"{projectdir}/addons/{libname}/bin/macos/{env["arch"]}/", - [ + copy_libraries = env.Install( + f"{projectdir}/addons/{libname}/bin/macos/{env["arch"]}", + source = [ f"ultralight/bin/macos/{env["arch"]}/libAppCore.dylib", f"ultralight/bin/macos/{env["arch"]}/libUltralight.dylib", f"ultralight/bin/macos/{env["arch"]}/libUltralightCore.dylib", f"ultralight/bin/macos/{env["arch"]}/libWebCore.dylib" ] - )) + ) -Execute(Copy( - f"{projectdir}/addons/{libname}/resources/", - [ +copy_resources = env.Install( + f"{projectdir}/addons/{libname}/resources", + source = [ "ultralight/resources/cacert.pem", "ultralight/resources/icudt67l.dat" ] -)) +) + +default_args = [library, copy, copy_libraries, copy_resources] +Default(*default_args) diff --git a/demo/addons/gdhtml/gdhtml.gdextension b/demo/addons/gdhtml/gdhtml.gdextension index b757444..176b5ad 100644 --- a/demo/addons/gdhtml/gdhtml.gdextension +++ b/demo/addons/gdhtml/gdhtml.gdextension @@ -20,17 +20,17 @@ macos.release.arm64 = { } windows.debug.x86_64 = { - "bin/windows/Ultralight.dll" : "", - "bin/windows/UltralightCore.dll" : "", - "bin/windows/WebCore.dll" : "", - "bin/windows/AppCore.dll" : "", + "bin/windows/x86_64/Ultralight.dll" : "", + "bin/windows/x86_64/UltralightCore.dll" : "", + "bin/windows/x86_64/WebCore.dll" : "", + "bin/windows/x86_64/AppCore.dll" : "", } windows.release.x86_64 = { - "bin/windows/Ultralight.dll" : "", - "bin/windows/UltralightCore.dll" : "", - "bin/windows/WebCore.dll" : "", - "bin/windows/AppCore.dll" : "", + "bin/windows/x86_64/Ultralight.dll" : "", + "bin/windows/x86_64/UltralightCore.dll" : "", + "bin/windows/x86_64/WebCore.dll" : "", + "bin/windows/x86_64/AppCore.dll" : "", } linux.debug.x86_64 = { @@ -52,8 +52,8 @@ linux.release.x86_64 = { macos.debug.arm64 = "bin/macos/arm64/gdhtml.macos.template_debug.arm64.dylib" macos.release.arm64 = "bin/macos/arm64/gdhtml.macos.template_release.arm64.dylib" -windows.debug.x86_64 = "bin/windows/gdhtml.windows.template_debug.x86_64.dll" -windows.release.x86_64 = "bin/windows/gdhtml.windows.template_release.x86_64.dll" +windows.debug.x86_64 = "bin/windows/x86_64/gdhtml.windows.template_debug.x86_64.dll" +windows.release.x86_64 = "bin/windows/x86_64/gdhtml.windows.template_release.x86_64.dll" linux.debug.x86_64 = "bin/linux/x86_64/gdhtml.linux.template_debug.x86_64.so" linux.release.x86_64 = "bin/linux/x86_64/gdhtml.linux.template_release.x86_64.so" From 870d70c56c1f91fb9c6656fc07f4eedadd94e499 Mon Sep 17 00:00:00 2001 From: Brett Johnson Date: Sat, 8 Mar 2025 02:12:34 -0600 Subject: [PATCH 2/2] Upload addon bin as artifact. Merge and copy resources. (#21) * Upload addon bin as artifact. Merge and copy resources. * Artifact into bin. copy resources, inspector, and license. --- .github/workflows/builds.yml | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index b527fc3..7ee75b6 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -104,7 +104,7 @@ jobs: with: name: gdhtml-${{ matrix.target.platform }}-${{ matrix.target.arch }}-${{ matrix.float-precision }}-${{ matrix.target-type }} path: | - ${{ github.workspace }}/bin/** + ${{ github.workspace }}/demo/addons/gdhtml/bin/** # Merges all the build artifacts together into a single gdhtml artifact. merge: @@ -122,9 +122,27 @@ jobs: permissions: write-all runs-on: ubuntu-22.04 needs: merge - env: - Download_Path: gdhtml-artifacts steps: + # Clone this repository + - name: Checkout + uses: actions/checkout@v4 + - name: Download Merged Artifacts + id: download_merge + uses: actions/download-artifact@v4 + with: + name: gdhtml + path: gdhtml/bin/ + - name: Copy Resources + id: copy_dependencies + shell: bash + run: | + cp demo/addons/gdhtml/gdhtml.gdextension gdhtml/ + cp -r ultralight/resources/ gdhtml/ + cp -r ultralight/inspector/ gdhtml/ + cp -r ultralight/license/ gdhtml/ + + - name: Zip Artifacts + run: zip -r gdhtml.zip gdhtml - name: Create Release id: create_release uses: actions/create-release@v1 @@ -134,14 +152,6 @@ jobs: tag_name: ${{ github.ref_name }} release_name: Release ${{ github.ref_name }} draft: true - - name: Download Merged Artifacts - id: download_merge - uses: actions/download-artifact@v4 - with: - name: gdhtml - path: ${{ env.Download_Path }} - - name: Zip Artifacts - run: zip -r gdhtml.zip ${{ env.Download_Path }} - name: Upload Release id: upload_release uses: actions/upload-release-asset@v1