From 5b3b042e32b0b4c1e8eec4619bf83582ce004082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thiago=20Henrique=20H=C3=BCpner?= Date: Thu, 15 Jan 2026 16:45:36 -0300 Subject: [PATCH 01/20] Update JDK version and paths in CI workflow --- .github/workflows/build-and-publish-bindings.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-publish-bindings.yml b/.github/workflows/build-and-publish-bindings.yml index f9bc73e..4508d89 100644 --- a/.github/workflows/build-and-publish-bindings.yml +++ b/.github/workflows/build-and-publish-bindings.yml @@ -20,13 +20,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - run: wget -O $RUNNER_TEMP/jdk.tar.gz https://download.java.net/java/early_access/jextract/22/5/openjdk-22-jextract+5-33_linux-x64_bin.tar.gz + - run: wget -O $RUNNER_TEMP/jdk.tar.gz https://download.java.net/java/early_access/jextract/25/2/openjdk-25-jextract+2-4_linux-x64_bin.tar.gz - run: tar -xf $RUNNER_TEMP/jdk.tar.gz - - run: echo "JEXTRACT_HOME=$(pwd)/jextract-22" >> $GITHUB_ENV + - run: echo "JEXTRACT_HOME=$(pwd)/jextract-25" >> $GITHUB_ENV - uses: actions/setup-java@v4 id: install-jdk with: - java-version: 21 + java-version: 25 distribution: temurin - name: Setup Gradle @@ -56,4 +56,4 @@ jobs: run: ./gradlew -PwgpuVersion=${{ inputs.wgpuVersion }} :lib:publish env: GITHUB_USER: ${{ github.actor }} - GITHUB_TOKEN: ${{ secrets.PKG_PUBLISHING_AUTH_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.PKG_PUBLISHING_AUTH_TOKEN }} From 70c58d514f19ecc910c88f19f3b9373784310604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thiago=20Henrique=20H=C3=BCpner?= Date: Thu, 15 Jan 2026 16:47:58 -0300 Subject: [PATCH 02/20] Upgrade Gradle wrapper to version 9.2.1 --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1af9e09..23449a2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From f7899b9ba52ec47ce6c3272c5a0691002e99c887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thiago=20Henrique=20H=C3=BCpner?= Date: Thu, 15 Jan 2026 16:53:43 -0300 Subject: [PATCH 03/20] Update path for webgpu.h in copyWgpuHeaders task --- natives/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/natives/build.gradle b/natives/build.gradle index 9cf46a1..e1d6212 100644 --- a/natives/build.gradle +++ b/natives/build.gradle @@ -24,10 +24,10 @@ task unzip(type: Copy) { } task copyWgpuHeaders(type: Copy) { - from "bin/$wgpuVersion/$os-$arch-$type/webgpu.h" + from "bin/$wgpuVersion/$os-$arch-$type/include/webgpu/webgpu.h" into 'build/headers/' } artifacts { headers file('build/headers/webgpu.h') -} \ No newline at end of file +} From 82e6c6ae2aef5071799455602ccff3cb177706a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thiago=20Henrique=20H=C3=BCpner?= Date: Thu, 15 Jan 2026 16:57:20 -0300 Subject: [PATCH 04/20] Upgrade Java version from 21 to 25 --- lib/build.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/build.gradle b/lib/build.gradle index cc4ecb5..e428b59 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -20,13 +20,13 @@ def jextractHome = project.hasProperty('jextract.home') : null java { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 + sourceCompatibility = JavaVersion.VERSION_25 + targetCompatibility = JavaVersion.VERSION_25 } java { toolchain { - languageVersion.set(JavaLanguageVersion.of(21)) + languageVersion.set(JavaLanguageVersion.of(25)) } } @@ -103,4 +103,4 @@ publishing { } } } -} \ No newline at end of file +} From 2b453bb35e4e18f2c30389d68e1de45c7e470bd2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 20:08:12 +0000 Subject: [PATCH 05/20] Initial plan From 6c93548b5d5ae3b640bab206e849d7ce5b640c46 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 20:11:14 +0000 Subject: [PATCH 06/20] Add Windows support to bindings build workflow - Add matrix strategy to build on both ubuntu-latest and windows-latest - Download and configure platform-specific jextract binaries - Use platform-specific Gradle commands and shell environments - Upload platform-specific binding artifacts Co-authored-by: Thihup <13357965+Thihup@users.noreply.github.com> --- .../workflows/build-and-publish-bindings.yml | 57 +++++++++++++++---- 1 file changed, 47 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-and-publish-bindings.yml b/.github/workflows/build-and-publish-bindings.yml index 4508d89..703b950 100644 --- a/.github/workflows/build-and-publish-bindings.yml +++ b/.github/workflows/build-and-publish-bindings.yml @@ -17,12 +17,49 @@ on: required: true jobs: build: - runs-on: ubuntu-latest + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + include: + - os: ubuntu-latest + jextract_url: https://download.java.net/java/early_access/jextract/25/2/openjdk-25-jextract+2-4_linux-x64_bin.tar.gz + jextract_archive: jdk.tar.gz + extract_command: tar -xf $RUNNER_TEMP/jdk.tar.gz + os_name: linux + gradle_cmd: ./gradlew + - os: windows-latest + jextract_url: https://download.java.net/java/early_access/jextract/25/2/openjdk-25-jextract+2-4_windows-x64_bin.zip + jextract_archive: jdk.zip + extract_command: Expand-Archive -Path $env:RUNNER_TEMP/jdk.zip -DestinationPath . + os_name: windows + gradle_cmd: .\gradlew.bat + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - run: wget -O $RUNNER_TEMP/jdk.tar.gz https://download.java.net/java/early_access/jextract/25/2/openjdk-25-jextract+2-4_linux-x64_bin.tar.gz - - run: tar -xf $RUNNER_TEMP/jdk.tar.gz - - run: echo "JEXTRACT_HOME=$(pwd)/jextract-25" >> $GITHUB_ENV + + - name: Download jextract (Linux) + if: matrix.os == 'ubuntu-latest' + run: wget -O $RUNNER_TEMP/${{ matrix.jextract_archive }} ${{ matrix.jextract_url }} + + - name: Download jextract (Windows) + if: matrix.os == 'windows-latest' + run: | + Invoke-WebRequest -Uri "${{ matrix.jextract_url }}" -OutFile "$env:RUNNER_TEMP\${{ matrix.jextract_archive }}" + shell: pwsh + + - name: Extract jextract + run: ${{ matrix.extract_command }} + shell: ${{ matrix.os == 'windows-latest' && 'pwsh' || 'bash' }} + + - name: Set JEXTRACT_HOME (Linux) + if: matrix.os == 'ubuntu-latest' + run: echo "JEXTRACT_HOME=$(pwd)/jextract-25" >> $GITHUB_ENV + + - name: Set JEXTRACT_HOME (Windows) + if: matrix.os == 'windows-latest' + run: echo "JEXTRACT_HOME=$((Get-Location).Path)\jextract-25" >> $env:GITHUB_ENV + shell: pwsh + - uses: actions/setup-java@v4 id: install-jdk with: @@ -35,25 +72,25 @@ jobs: gradle-version: wrapper - name: Download natives - run: ./gradlew -PwgpuVersion=${{ inputs.wgpuVersion }} :natives:download + run: ${{ matrix.gradle_cmd }} -PwgpuVersion=${{ inputs.wgpuVersion }} -Pos=${{ matrix.os_name }} :natives:download - name: Extract natives - run: ./gradlew -PwgpuVersion=${{ inputs.wgpuVersion }} :natives:unzip + run: ${{ matrix.gradle_cmd }} -PwgpuVersion=${{ inputs.wgpuVersion }} -Pos=${{ matrix.os_name }} :natives:unzip - name: Copy headers - run: ./gradlew -PwgpuVersion=${{ inputs.wgpuVersion }} ':natives:copyWgpuHeaders' + run: ${{ matrix.gradle_cmd }} -PwgpuVersion=${{ inputs.wgpuVersion }} -Pos=${{ matrix.os_name }} ':natives:copyWgpuHeaders' - name: Generate bindings - run: ./gradlew -PwgpuVersion=${{ inputs.wgpuVersion }} -Pjextract.home=${{ env.JEXTRACT_HOME }} :lib:bindings + run: ${{ matrix.gradle_cmd }} -PwgpuVersion=${{ inputs.wgpuVersion }} -Pjextract.home=${{ env.JEXTRACT_HOME }} :lib:bindings - name: Publish bindings as artifact uses: actions/upload-artifact@v4 with: - name: webgpu-bindings + name: webgpu-bindings-${{ matrix.os_name }} path: lib/build/webgpu.jar - name: Publish bindings to GH packages - run: ./gradlew -PwgpuVersion=${{ inputs.wgpuVersion }} :lib:publish + run: ${{ matrix.gradle_cmd }} -PwgpuVersion=${{ inputs.wgpuVersion }} :lib:publish env: GITHUB_USER: ${{ github.actor }} GITHUB_TOKEN: ${{ secrets.PKG_PUBLISHING_AUTH_TOKEN }} From 97c284231919ad846a4893539e5163044a61ed6b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 20:12:23 +0000 Subject: [PATCH 07/20] Update natives build.gradle to support Windows toolchain - Add toolchain parameter to handle Windows-specific naming (msvc/gnu) - Construct platform string correctly for Windows (windows-x86_64-msvc) - Update file paths to use dynamic platformString variable Co-authored-by: Thihup <13357965+Thihup@users.noreply.github.com> --- natives/build.gradle | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/natives/build.gradle b/natives/build.gradle index e1d6212..a5d15a3 100644 --- a/natives/build.gradle +++ b/natives/build.gradle @@ -12,19 +12,24 @@ def wgpuVersion = project.findProperty('wgpuVersion') def os = project.hasProperty('os') ? project.findProperty('os') : 'linux' def arch = project.hasProperty('arch') ? project.findProperty('arch') : 'x86_64' def type = project.hasProperty('type') ? project.findProperty('type') : 'debug' +def toolchain = project.hasProperty('toolchain') ? project.findProperty('toolchain') : (os == 'windows' ? 'msvc' : '') + +// Construct the platform string based on OS +def platformString = os == 'windows' ? "$os-$arch-$toolchain" : "$os-$arch" +def fileName = "wgpu-$platformString-${type}.zip" task download(type: Download) { - src "https://github.com/gfx-rs/wgpu-native/releases/download/$wgpuVersion/wgpu-$os-$arch-${type}.zip" - dest "bin/$wgpuVersion/$os-$arch-${type}.zip" + src "https://github.com/gfx-rs/wgpu-native/releases/download/$wgpuVersion/$fileName" + dest "bin/$wgpuVersion/$fileName" } task unzip(type: Copy) { - from zipTree("bin/$wgpuVersion/$os-$arch-${type}.zip") - into "bin/$wgpuVersion/$os-$arch-$type" + from zipTree("bin/$wgpuVersion/$fileName") + into "bin/$wgpuVersion/$platformString-$type" } task copyWgpuHeaders(type: Copy) { - from "bin/$wgpuVersion/$os-$arch-$type/include/webgpu/webgpu.h" + from "bin/$wgpuVersion/$platformString-$type/include/webgpu/webgpu.h" into 'build/headers/' } From f8f161c35a8cbdbe63a4af52b99a1ab6e70cd91b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 20:13:18 +0000 Subject: [PATCH 08/20] Simplify workflow by splitting extract steps - Split extract jextract into separate Linux and Windows steps - Remove extract_command from matrix as it's no longer needed - Use explicit shell directives for each platform Co-authored-by: Thihup <13357965+Thihup@users.noreply.github.com> --- .github/workflows/build-and-publish-bindings.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-publish-bindings.yml b/.github/workflows/build-and-publish-bindings.yml index 703b950..0588ebc 100644 --- a/.github/workflows/build-and-publish-bindings.yml +++ b/.github/workflows/build-and-publish-bindings.yml @@ -24,13 +24,11 @@ jobs: - os: ubuntu-latest jextract_url: https://download.java.net/java/early_access/jextract/25/2/openjdk-25-jextract+2-4_linux-x64_bin.tar.gz jextract_archive: jdk.tar.gz - extract_command: tar -xf $RUNNER_TEMP/jdk.tar.gz os_name: linux gradle_cmd: ./gradlew - os: windows-latest jextract_url: https://download.java.net/java/early_access/jextract/25/2/openjdk-25-jextract+2-4_windows-x64_bin.zip jextract_archive: jdk.zip - extract_command: Expand-Archive -Path $env:RUNNER_TEMP/jdk.zip -DestinationPath . os_name: windows gradle_cmd: .\gradlew.bat runs-on: ${{ matrix.os }} @@ -47,9 +45,14 @@ jobs: Invoke-WebRequest -Uri "${{ matrix.jextract_url }}" -OutFile "$env:RUNNER_TEMP\${{ matrix.jextract_archive }}" shell: pwsh - - name: Extract jextract - run: ${{ matrix.extract_command }} - shell: ${{ matrix.os == 'windows-latest' && 'pwsh' || 'bash' }} + - name: Extract jextract (Linux) + if: matrix.os == 'ubuntu-latest' + run: tar -xf $RUNNER_TEMP/jdk.tar.gz + + - name: Extract jextract (Windows) + if: matrix.os == 'windows-latest' + run: Expand-Archive -Path $env:RUNNER_TEMP/jdk.zip -DestinationPath . + shell: pwsh - name: Set JEXTRACT_HOME (Linux) if: matrix.os == 'ubuntu-latest' From d38dbe420aa921137a273fe52357a637972d192d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 20:14:38 +0000 Subject: [PATCH 09/20] Address code review feedback - Use matrix.jextract_archive variable in extract steps - Improve toolchain handling to use null instead of empty string - Add explicit null check in platformString construction Co-authored-by: Thihup <13357965+Thihup@users.noreply.github.com> --- .github/workflows/build-and-publish-bindings.yml | 4 ++-- natives/build.gradle | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-publish-bindings.yml b/.github/workflows/build-and-publish-bindings.yml index 0588ebc..51aefe6 100644 --- a/.github/workflows/build-and-publish-bindings.yml +++ b/.github/workflows/build-and-publish-bindings.yml @@ -47,11 +47,11 @@ jobs: - name: Extract jextract (Linux) if: matrix.os == 'ubuntu-latest' - run: tar -xf $RUNNER_TEMP/jdk.tar.gz + run: tar -xf $RUNNER_TEMP/${{ matrix.jextract_archive }} - name: Extract jextract (Windows) if: matrix.os == 'windows-latest' - run: Expand-Archive -Path $env:RUNNER_TEMP/jdk.zip -DestinationPath . + run: Expand-Archive -Path $env:RUNNER_TEMP\${{ matrix.jextract_archive }} -DestinationPath . shell: pwsh - name: Set JEXTRACT_HOME (Linux) diff --git a/natives/build.gradle b/natives/build.gradle index a5d15a3..19e8204 100644 --- a/natives/build.gradle +++ b/natives/build.gradle @@ -12,10 +12,10 @@ def wgpuVersion = project.findProperty('wgpuVersion') def os = project.hasProperty('os') ? project.findProperty('os') : 'linux' def arch = project.hasProperty('arch') ? project.findProperty('arch') : 'x86_64' def type = project.hasProperty('type') ? project.findProperty('type') : 'debug' -def toolchain = project.hasProperty('toolchain') ? project.findProperty('toolchain') : (os == 'windows' ? 'msvc' : '') +def toolchain = project.hasProperty('toolchain') ? project.findProperty('toolchain') : (os == 'windows' ? 'msvc' : null) // Construct the platform string based on OS -def platformString = os == 'windows' ? "$os-$arch-$toolchain" : "$os-$arch" +def platformString = (os == 'windows' && toolchain) ? "$os-$arch-$toolchain" : "$os-$arch" def fileName = "wgpu-$platformString-${type}.zip" task download(type: Download) { From b26be527422509063c9e32d779925366700404e0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 20:15:57 +0000 Subject: [PATCH 10/20] Add explicit permissions to workflow for security - Set contents: read and packages: write permissions - Addresses CodeQL security alert about missing workflow permissions Co-authored-by: Thihup <13357965+Thihup@users.noreply.github.com> --- .github/workflows/build-and-publish-bindings.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-and-publish-bindings.yml b/.github/workflows/build-and-publish-bindings.yml index 51aefe6..0cd234b 100644 --- a/.github/workflows/build-and-publish-bindings.yml +++ b/.github/workflows/build-and-publish-bindings.yml @@ -17,6 +17,9 @@ on: required: true jobs: build: + permissions: + contents: read + packages: write strategy: matrix: os: [ubuntu-latest, windows-latest] From 8c1c1128183e96d70ec705a20169d1ed0c781320 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 21:21:50 +0000 Subject: [PATCH 11/20] Fix Windows jextract download to use tar.gz - Change Windows jextract URL from .zip to .tar.gz - Update Windows extraction to use tar command instead of Expand-Archive - Both Linux and Windows now use tar.gz archives Co-authored-by: Thihup <13357965+Thihup@users.noreply.github.com> --- .github/workflows/build-and-publish-bindings.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-publish-bindings.yml b/.github/workflows/build-and-publish-bindings.yml index 0cd234b..676c79f 100644 --- a/.github/workflows/build-and-publish-bindings.yml +++ b/.github/workflows/build-and-publish-bindings.yml @@ -30,8 +30,8 @@ jobs: os_name: linux gradle_cmd: ./gradlew - os: windows-latest - jextract_url: https://download.java.net/java/early_access/jextract/25/2/openjdk-25-jextract+2-4_windows-x64_bin.zip - jextract_archive: jdk.zip + jextract_url: https://download.java.net/java/early_access/jextract/25/2/openjdk-25-jextract+2-4_windows-x64_bin.tar.gz + jextract_archive: jdk.tar.gz os_name: windows gradle_cmd: .\gradlew.bat runs-on: ${{ matrix.os }} @@ -54,7 +54,7 @@ jobs: - name: Extract jextract (Windows) if: matrix.os == 'windows-latest' - run: Expand-Archive -Path $env:RUNNER_TEMP\${{ matrix.jextract_archive }} -DestinationPath . + run: tar -xf $env:RUNNER_TEMP\${{ matrix.jextract_archive }} shell: pwsh - name: Set JEXTRACT_HOME (Linux) From 3bcb1c8a99bf9ec8c8d83431829376e8ec5917ed Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 16 Jan 2026 02:07:24 +0000 Subject: [PATCH 12/20] Quote Gradle parameters to fix Windows parsing - Add quotes around -PwgpuVersion and -Pos parameters - Fixes issue where version strings with periods (v27.0.4.0) were being incorrectly parsed on Windows - Prevents "Task '.0.4.0' not found" error Co-authored-by: Thihup <13357965+Thihup@users.noreply.github.com> --- .github/workflows/build-and-publish-bindings.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-publish-bindings.yml b/.github/workflows/build-and-publish-bindings.yml index 676c79f..de1505e 100644 --- a/.github/workflows/build-and-publish-bindings.yml +++ b/.github/workflows/build-and-publish-bindings.yml @@ -78,16 +78,16 @@ jobs: gradle-version: wrapper - name: Download natives - run: ${{ matrix.gradle_cmd }} -PwgpuVersion=${{ inputs.wgpuVersion }} -Pos=${{ matrix.os_name }} :natives:download + run: ${{ matrix.gradle_cmd }} "-PwgpuVersion=${{ inputs.wgpuVersion }}" "-Pos=${{ matrix.os_name }}" :natives:download - name: Extract natives - run: ${{ matrix.gradle_cmd }} -PwgpuVersion=${{ inputs.wgpuVersion }} -Pos=${{ matrix.os_name }} :natives:unzip + run: ${{ matrix.gradle_cmd }} "-PwgpuVersion=${{ inputs.wgpuVersion }}" "-Pos=${{ matrix.os_name }}" :natives:unzip - name: Copy headers - run: ${{ matrix.gradle_cmd }} -PwgpuVersion=${{ inputs.wgpuVersion }} -Pos=${{ matrix.os_name }} ':natives:copyWgpuHeaders' + run: ${{ matrix.gradle_cmd }} "-PwgpuVersion=${{ inputs.wgpuVersion }}" "-Pos=${{ matrix.os_name }}" ':natives:copyWgpuHeaders' - name: Generate bindings - run: ${{ matrix.gradle_cmd }} -PwgpuVersion=${{ inputs.wgpuVersion }} -Pjextract.home=${{ env.JEXTRACT_HOME }} :lib:bindings + run: ${{ matrix.gradle_cmd }} "-PwgpuVersion=${{ inputs.wgpuVersion }}" "-Pjextract.home=${{ env.JEXTRACT_HOME }}" :lib:bindings - name: Publish bindings as artifact uses: actions/upload-artifact@v4 @@ -96,7 +96,7 @@ jobs: path: lib/build/webgpu.jar - name: Publish bindings to GH packages - run: ${{ matrix.gradle_cmd }} -PwgpuVersion=${{ inputs.wgpuVersion }} :lib:publish + run: ${{ matrix.gradle_cmd }} "-PwgpuVersion=${{ inputs.wgpuVersion }}" :lib:publish env: GITHUB_USER: ${{ github.actor }} GITHUB_TOKEN: ${{ secrets.PKG_PUBLISHING_AUTH_TOKEN }} From 70f29063ac7902625a5fa3a35afc9a4e21d5a36c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thiago=20Henrique=20H=C3=BCpner?= Date: Fri, 16 Jan 2026 08:12:11 -0300 Subject: [PATCH 13/20] Disable fail-fast in build and publish workflow --- .github/workflows/build-and-publish-bindings.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-publish-bindings.yml b/.github/workflows/build-and-publish-bindings.yml index de1505e..20d34f4 100644 --- a/.github/workflows/build-and-publish-bindings.yml +++ b/.github/workflows/build-and-publish-bindings.yml @@ -21,6 +21,7 @@ jobs: contents: read packages: write strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest] include: From 33d57d7628560f6fa838eec3effbcd2b1f2c2561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thiago=20Henrique=20H=C3=BCpner?= Date: Fri, 16 Jan 2026 08:15:59 -0300 Subject: [PATCH 14/20] Add stacktrace option to bindings generation command --- .github/workflows/build-and-publish-bindings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-publish-bindings.yml b/.github/workflows/build-and-publish-bindings.yml index 20d34f4..7aac654 100644 --- a/.github/workflows/build-and-publish-bindings.yml +++ b/.github/workflows/build-and-publish-bindings.yml @@ -88,7 +88,7 @@ jobs: run: ${{ matrix.gradle_cmd }} "-PwgpuVersion=${{ inputs.wgpuVersion }}" "-Pos=${{ matrix.os_name }}" ':natives:copyWgpuHeaders' - name: Generate bindings - run: ${{ matrix.gradle_cmd }} "-PwgpuVersion=${{ inputs.wgpuVersion }}" "-Pjextract.home=${{ env.JEXTRACT_HOME }}" :lib:bindings + run: ${{ matrix.gradle_cmd }} "--stacktrace" "-PwgpuVersion=${{ inputs.wgpuVersion }}" "-Pjextract.home=${{ env.JEXTRACT_HOME }}" :lib:bindings - name: Publish bindings as artifact uses: actions/upload-artifact@v4 From 99323aac01f7f552b864e69b32c00034a7113e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thiago=20Henrique=20H=C3=BCpner?= Date: Fri, 16 Jan 2026 08:26:49 -0300 Subject: [PATCH 15/20] Add OS detection for jextract executable --- lib/build.gradle | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/build.gradle b/lib/build.gradle index e428b59..8a1282d 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -1,4 +1,7 @@ import java.nio.file.Paths +import org.gradle.internal.os.OperatingSystem + +def isWindows = OperatingSystem.current().isWindows() plugins { id 'java-library' @@ -50,10 +53,11 @@ task invokeJextract(type: Exec){ doFirst { file('build/bindings').mkdirs() } + def exeName = isWindows ? 'jextract.bat' : 'jextract' if(jextractHome){ - executable Paths.get(jextractHome as String, 'bin', 'jextract') + executable Paths.get(jextractHome as String, 'bin', exeName).toString() }else{ - executable 'jextract' + executable exeName } args ( configurations.headers.files[0], From f5470c72a401fd0643982e40126e7b19f4a322bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thiago=20Henrique=20H=C3=BCpner?= Date: Fri, 16 Jan 2026 08:29:24 -0300 Subject: [PATCH 16/20] Move isWindows definition to a new line --- lib/build.gradle | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/build.gradle b/lib/build.gradle index 8a1282d..929d92a 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -1,13 +1,12 @@ import java.nio.file.Paths import org.gradle.internal.os.OperatingSystem -def isWindows = OperatingSystem.current().isWindows() - plugins { id 'java-library' id 'maven-publish' } +def isWindows = OperatingSystem.current().isWindows() def wgpuVersion = project.findProperty('wgpuVersion') configurations { From 47aaa533666b909378f4e3b6556e7e967e52f4b0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 16 Jan 2026 11:58:11 +0000 Subject: [PATCH 17/20] Initial plan From 4d7d649b52543b26b3dc43c8367975310497cb71 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 16 Jan 2026 12:01:51 +0000 Subject: [PATCH 18/20] Add sources JAR generation and publishing for JExtract generated code Co-authored-by: Thihup <13357965+Thihup@users.noreply.github.com> --- .github/workflows/build-and-publish-bindings.yml | 4 +++- lib/build.gradle | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-publish-bindings.yml b/.github/workflows/build-and-publish-bindings.yml index 7aac654..d43fe31 100644 --- a/.github/workflows/build-and-publish-bindings.yml +++ b/.github/workflows/build-and-publish-bindings.yml @@ -94,7 +94,9 @@ jobs: uses: actions/upload-artifact@v4 with: name: webgpu-bindings-${{ matrix.os_name }} - path: lib/build/webgpu.jar + path: | + lib/build/webgpu.jar + lib/build/webgpu-sources.jar - name: Publish bindings to GH packages run: ${{ matrix.gradle_cmd }} "-PwgpuVersion=${{ inputs.wgpuVersion }}" :lib:publish diff --git a/lib/build.gradle b/lib/build.gradle index 929d92a..d81a3ae 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -80,8 +80,14 @@ task jextract(dependsOn: [invokeJextract, cleanupExtras]) tasks.findByName('compileJava').dependsOn jextract -task bindings(type: Copy, dependsOn: [jextract, jar]){ +task sourcesJar(type: Jar, dependsOn: jextract) { + archiveClassifier = 'sources' + from 'build/bindings' +} + +task bindings(type: Copy, dependsOn: [jextract, jar, sourcesJar]){ from jar + from sourcesJar into 'build' } @@ -93,6 +99,7 @@ publishing { version = "$wgpuVersion" artifact file("build/webgpu.jar") + artifact sourcesJar } } repositories { From f1e8030d8d7d2c1192dee0b4b3745c29c87fcd02 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 16 Jan 2026 12:03:19 +0000 Subject: [PATCH 19/20] Explicitly set archiveBaseName for sourcesJar task Co-authored-by: Thihup <13357965+Thihup@users.noreply.github.com> --- lib/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/build.gradle b/lib/build.gradle index d81a3ae..fc8806a 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -81,6 +81,7 @@ task jextract(dependsOn: [invokeJextract, cleanupExtras]) tasks.findByName('compileJava').dependsOn jextract task sourcesJar(type: Jar, dependsOn: jextract) { + archiveBaseName = 'webgpu' archiveClassifier = 'sources' from 'build/bindings' } From 0a289b8b463d0fae98b434a01a0962f4c9c98044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thiago=20Henrique=20H=C3=BCpner?= Date: Fri, 16 Jan 2026 09:20:11 -0300 Subject: [PATCH 20/20] Add '--library' option to jextract args --- lib/build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/build.gradle b/lib/build.gradle index fc8806a..c63b971 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -61,7 +61,8 @@ task invokeJextract(type: Exec){ args ( configurations.headers.files[0], '-t', 'com.myworldvw.webgpu', - '--output', 'build/bindings' + '--output', 'build/bindings', + '--library', 'wgpu_native' ) }