diff --git a/.github/workflows/zig.yml b/.github/workflows/zig.yml index 06021ae5..380ff0b0 100644 --- a/.github/workflows/zig.yml +++ b/.github/workflows/zig.yml @@ -7,10 +7,10 @@ on: - zig/** env: - VERSION: 0.13.0 + ZIG_VERSION: 0.13.0 jobs: - zig_test: + godot_zig: container: image: barichello/godot-ci:4.3 strategy: @@ -21,12 +21,25 @@ jobs: - uses: actions/checkout@v3 with: submodules: recursive - - uses: goto-bus-stop/setup-zig@v2 - with: - version: ${{env.VERSION}} + lfs: true + - name: Install Zig + run: | + apt-get update + apt-get upgrade -y + apt-get install xz-utils -y + mkdir -p ~/sdk/zig + mkdir -p /home/downloads + wget https://ziglang.org/download/${{env.ZIG_VERSION}}/zig-linux-x86_64-${{env.ZIG_VERSION}}.tar.xz -O /home/downloads/zig-linux-x86_64-${{env.ZIG_VERSION}}.tar.xz + tar -xf /home/downloads/zig-linux-x86_64-${{env.ZIG_VERSION}}.tar.xz -C ~/sdk/zig + cp -r ~/sdk/zig/zig-linux-x86_64-${{env.ZIG_VERSION}}/* ~/sdk/zig + rm -rf ~/sdk/zig/zig-linux-x86_64-${{env.ZIG_VERSION}} + export PATH=$PATH:~/sdk/zig + echo "export PATH=$PATH:~/sdk/zig" >> ~/.bashrc - name: Generate Godot Project run: godot -e --path ../godot --import --headless + working-directory: ./zig - name: Generate Zig Bindings + working-directory: ./zig run: zig build bind - name: Test working-directory: ./zig diff --git a/.gitignore b/.gitignore index ec330ee8..cd62fe00 100644 --- a/.gitignore +++ b/.gitignore @@ -404,3 +404,8 @@ $RECYCLE.BIN/ *.msp *.lnk *.generated.props + +!/godot/addons/**/bin +!/godot/addons/**/bin/**/*.so +!/godot/addons/**/bin/**/*.dylib +!/godot/addons/**/bin/**/*.dll diff --git a/godot/addons/discord-rpc-gd/bin/discord-rpc-gd.gdextension b/godot/addons/discord-rpc-gd/bin/discord-rpc-gd.gdextension new file mode 100644 index 00000000..27e28455 --- /dev/null +++ b/godot/addons/discord-rpc-gd/bin/discord-rpc-gd.gdextension @@ -0,0 +1,29 @@ +[configuration] + +entry_symbol = "discordrpcgd_library_init" +compatibility_minimum = 4.1 + +[libraries] + +macos.debug = "macos/libdiscord_game_sdk_binding_debug.dylib" +macos.release = "macos/libdiscord_game_sdk_binding.dylib" +windows.debug.x86_64 = "windows/discord_game_sdk_binding_debug.dll" +windows.release.x86_64 = "windows/discord_game_sdk_binding.dll" +linux.debug.x86_64 = "linux/libdiscord_game_sdk_binding_debug.so" +linux.release.x86_64 = "linux/libdiscord_game_sdk_binding.so" +linux.debug.arm64 = "linux/libdiscord_game_sdk_binding_debug.so" +linux.release.arm64 = "linux/libdiscord_game_sdk_binding.so" +linux.debug.rv64 = "linux/libdiscord_game_sdk_binding_debug.so" +linux.release.rv64 = "linux/libdiscord_game_sdk_binding.so" + +[dependencies] + +macos = { "macos/libdiscord_game_sdk.dylib": "" } +windows.debug.x86_64 = { "windows/discord_game_sdk.dll": "" } +windows.release.x86_64 = { "windows/discord_game_sdk.dll": "" } +linux.debug.x86_64 = { "linux/libdiscord_game_sdk.so": "" } +linux.release.x86_64 = { "linux/libdiscord_game_sdk.so": "" } +linux.debug.arm64 = { "linux/libdiscord_game_sdk.so": "" } +linux.release.arm64 = { "linux/libdiscord_game_sdk.so": "" } +linux.debug.rv64 = { "linux/libdiscord_game_sdk.so": "" } +linux.release.rv64 = { "linux/libdiscord_game_sdk.so": "" } diff --git a/godot/addons/discord-rpc-gd/bin/linux/libdiscord_game_sdk.so b/godot/addons/discord-rpc-gd/bin/linux/libdiscord_game_sdk.so new file mode 100644 index 00000000..9dacf946 Binary files /dev/null and b/godot/addons/discord-rpc-gd/bin/linux/libdiscord_game_sdk.so differ diff --git a/godot/addons/discord-rpc-gd/bin/linux/libdiscord_game_sdk_binding.so b/godot/addons/discord-rpc-gd/bin/linux/libdiscord_game_sdk_binding.so new file mode 100644 index 00000000..f9863c4f Binary files /dev/null and b/godot/addons/discord-rpc-gd/bin/linux/libdiscord_game_sdk_binding.so differ diff --git a/godot/addons/discord-rpc-gd/bin/linux/libdiscord_game_sdk_binding_debug.so b/godot/addons/discord-rpc-gd/bin/linux/libdiscord_game_sdk_binding_debug.so new file mode 100644 index 00000000..89bf7dac Binary files /dev/null and b/godot/addons/discord-rpc-gd/bin/linux/libdiscord_game_sdk_binding_debug.so differ diff --git a/godot/addons/discord-rpc-gd/bin/macos/libdiscord_game_sdk.dylib b/godot/addons/discord-rpc-gd/bin/macos/libdiscord_game_sdk.dylib new file mode 100644 index 00000000..2cc726dd Binary files /dev/null and b/godot/addons/discord-rpc-gd/bin/macos/libdiscord_game_sdk.dylib differ diff --git a/godot/addons/discord-rpc-gd/bin/macos/libdiscord_game_sdk_binding.dylib b/godot/addons/discord-rpc-gd/bin/macos/libdiscord_game_sdk_binding.dylib new file mode 100644 index 00000000..cfcd1a7c Binary files /dev/null and b/godot/addons/discord-rpc-gd/bin/macos/libdiscord_game_sdk_binding.dylib differ diff --git a/godot/addons/discord-rpc-gd/bin/macos/libdiscord_game_sdk_binding_debug.dylib b/godot/addons/discord-rpc-gd/bin/macos/libdiscord_game_sdk_binding_debug.dylib new file mode 100644 index 00000000..082e3966 Binary files /dev/null and b/godot/addons/discord-rpc-gd/bin/macos/libdiscord_game_sdk_binding_debug.dylib differ diff --git a/godot/addons/discord-rpc-gd/bin/windows/discord_game_sdk.dll b/godot/addons/discord-rpc-gd/bin/windows/discord_game_sdk.dll new file mode 100644 index 00000000..be946ea7 Binary files /dev/null and b/godot/addons/discord-rpc-gd/bin/windows/discord_game_sdk.dll differ diff --git a/godot/addons/discord-rpc-gd/bin/windows/discord_game_sdk_binding.dll b/godot/addons/discord-rpc-gd/bin/windows/discord_game_sdk_binding.dll new file mode 100644 index 00000000..77ffef2b Binary files /dev/null and b/godot/addons/discord-rpc-gd/bin/windows/discord_game_sdk_binding.dll differ diff --git a/godot/addons/discord-rpc-gd/bin/windows/discord_game_sdk_binding_debug.dll b/godot/addons/discord-rpc-gd/bin/windows/discord_game_sdk_binding_debug.dll new file mode 100644 index 00000000..2b52a76b Binary files /dev/null and b/godot/addons/discord-rpc-gd/bin/windows/discord_game_sdk_binding_debug.dll differ diff --git a/godot/addons/discord-rpc-gd/bin/windows/discord_game_sdk_x86.dll b/godot/addons/discord-rpc-gd/bin/windows/discord_game_sdk_x86.dll new file mode 100644 index 00000000..45b9bb17 Binary files /dev/null and b/godot/addons/discord-rpc-gd/bin/windows/discord_game_sdk_x86.dll differ diff --git a/zig/src/main.zig b/zig/src/main.zig index 933321a7..8998d8df 100644 --- a/zig/src/main.zig +++ b/zig/src/main.zig @@ -3,7 +3,7 @@ const Godot = @import("godot"); const builtin = @import("builtin"); const GPA = std.heap.GeneralPurposeAllocator(.{}); -// 2 +// 3 var gpa = GPA{};