From 630d13ebb21abb926b4ab27769c0bf25f7562e0d Mon Sep 17 00:00:00 2001
From: Chance <caznix01@gmail.com>
Date: Fri, 18 Apr 2025 23:59:21 -0400
Subject: [PATCH 1/3] Revert "fix(ci): ensure node is installed"

This reverts commit cb91bde7f8545793699e374618447f85c5b5d0f0.
---
 .forgejo/workflows/build-release.yml | 127 +++++++++++++--------------
 1 file changed, 62 insertions(+), 65 deletions(-)

diff --git a/.forgejo/workflows/build-release.yml b/.forgejo/workflows/build-release.yml
index 101d8ec..08ba874 100644
--- a/.forgejo/workflows/build-release.yml
+++ b/.forgejo/workflows/build-release.yml
@@ -1,78 +1,75 @@
-  name: Build Zenyx ⚡
+name: Build Zenyx ⚡
 
-  on:
-    push:
-    pull_request:
+on:
+  push:
+  pull_request:
 
-  jobs:
-    build:
-      name: Build ${{ matrix.target }}
-      runs-on: ubuntu-latest
-      container: ${{ matrix.container }}
+jobs:
+  build:
+    name: Build ${{ matrix.target }}
+    runs-on: ubuntu-latest
+    container: ${{ matrix.container }}
 
-      strategy:
-        fail-fast: false
-        matrix:
-          include:
-            - target: x86_64-unknown-linux-gnu
-              container: messense/cargo-zigbuild:latest
-              binary_name: zenyx-x86_64-linux
-              ext: ""
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - target: x86_64-unknown-linux-gnu
+            container: messense/cargo-zigbuild:latest
+            binary_name: zenyx-x86_64-linux
+            ext: ""
 
-            - target: aarch64-unknown-linux-gnu
-              container: messense/cargo-zigbuild:latest
-              binary_name: zenyx-aarch64-linux
-              ext: ""
+          - target: aarch64-unknown-linux-gnu
+            container: messense/cargo-zigbuild:latest
+            binary_name: zenyx-aarch64-linux
+            ext: ""
 
-            - target: universal2-apple-darwin
-              container: messense/cargo-zigbuild:latest
-              binary_name: zenyx-universal-macos
-              ext: ""
+          - target: universal2-apple-darwin
+            container: messense/cargo-zigbuild:latest
+            binary_name: zenyx-universal-macos
+            ext: ""
 
-            - target: x86_64-pc-windows-msvc
-              container: messense/cargo-xwin:latest
-              binary_name: zenyx-x86_64-windows-msvc.exe
-              ext: ".exe"
+          - target: x86_64-pc-windows-msvc
+            container: messense/cargo-xwin:latest
+            binary_name: zenyx-x86_64-windows-msvc.exe
+            ext: ".exe"
 
-      steps:
-        - name: Ensure nodejs
-          run: |
-            apt-get -y install nodejs
-        - name: 📥 Checkout source
-          uses: https://github.com/actions/checkout@v4
+    steps:
+      - name: 📥 Checkout source
+        uses: https://github.com/actions/checkout@v4
 
-        - name: 🧩 Restore Cargo cache
-          uses: https://github.com/actions/cache@v4
-          with:
-            path: |
-              /usr/local/cargo/registry
-              /usr/local/cargo/git
-              target
-            key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
-            restore-keys: |
-              ${{ runner.os }}-cargo-${{ matrix.target }}-
+      - name: 🧩 Restore Cargo cache
+        uses: https://github.com/actions/cache@v4
+        with:
+          path: |
+            /usr/local/cargo/registry
+            /usr/local/cargo/git
+            target
+          key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
+          restore-keys: |
+            ${{ runner.os }}-cargo-${{ matrix.target }}-
 
-        - name: 🦀 Install macOS targets
-          if: matrix.target == 'universal2-apple-darwin'
-          uses: https://github.com/actions-rs/toolchain@v1
-          with:
-            target: x86_64-apple-darwin,aarch64-apple-darwin
+      - name: 🦀 Install macOS targets
+        if: matrix.target == 'universal2-apple-darwin'
+        uses: https://github.com/actions-rs/toolchain@v1
+        with:
+          target: x86_64-apple-darwin,aarch64-apple-darwin
 
-        - name: 🚀 Build project
-          run: |
-            cargo zigbuild --target ${{ matrix.target }} --release
-          if: matrix.target != 'x86_64-pc-windows-msvc'
+      - name: 🚀 Build project
+        run: |
+          cargo zigbuild --target ${{ matrix.target }} --release
+        if: matrix.target != 'x86_64-pc-windows-msvc'
 
-        - name: 🚀 Build Windows project
-          run: |
-            cargo xwin build --target ${{ matrix.target }} --release
-          if: matrix.target == 'x86_64-pc-windows-msvc'
+      - name: 🚀 Build Windows project
+        run: |
+          cargo xwin build --target ${{ matrix.target }} --release
+        if: matrix.target == 'x86_64-pc-windows-msvc'
 
-        - name: 📦 Package artifact
-          run: mkdir -p artifacts && cp target/${{ matrix.target }}/release/zenyx${{ matrix.ext }} artifacts/${{ matrix.binary_name }}
+      - name: 📦 Package artifact
+        run: mkdir -p artifacts && cp target/${{ matrix.target }}/release/zenyx${{ matrix.ext }} artifacts/${{ matrix.binary_name }}
 
-        - name: ⬆️ Upload artifact
-          uses: https://code.forgejo.org/forgejo/upload-artifact@v4
-          with:
-            name: ${{ matrix.binary_name }}
-            path: artifacts/${{ matrix.binary_name }}
\ No newline at end of file
+      - name: ⬆️ Upload artifact
+        uses: https://code.forgejo.org/forgejo/upload-artifact@v4
+        with:
+          name: ${{ matrix.binary_name }}
+          path: artifacts/${{ matrix.binary_name }}
\ No newline at end of file

From 6815a113cc57bdd0b704fd5e5d12a77cca7b99ca Mon Sep 17 00:00:00 2001
From: Chance <caznix01@gmail.com>
Date: Sat, 19 Apr 2025 00:00:46 -0400
Subject: [PATCH 2/3] Revert "feat(ci): use cargo zibuild & xbuild"

This reverts commit 87d810aff371639996822ad90d0971f1a176bbb0.
---
 .forgejo/workflows/build-release.yml | 97 +++++++++++++++++++---------
 1 file changed, 65 insertions(+), 32 deletions(-)

diff --git a/.forgejo/workflows/build-release.yml b/.forgejo/workflows/build-release.yml
index 08ba874..e3d7f9e 100644
--- a/.forgejo/workflows/build-release.yml
+++ b/.forgejo/workflows/build-release.yml
@@ -5,32 +5,58 @@ on:
   pull_request:
 
 jobs:
-  build:
-    name: Build ${{ matrix.target }}
+  setup:
+    name: 🔧 Setup Environment
     runs-on: ubuntu-latest
-    container: ${{ matrix.container }}
+    outputs:
+      cache-hit: ${{ steps.cache-tools.outputs.cache-hit }}
+    steps:
+      - name: 📥 Checkout source
+        uses: https://github.com/actions/checkout@v4
 
+      - name: 🗄️ Cache tools
+        uses: https://github.com/actions/cache@v4
+        id: cache-tools
+        with:
+          path: |
+            ~/.cargo/bin
+            /tmp/zig
+          key: tools-v1-${{ hashFiles('**/Cargo.lock') }}
+
+      - name: 🦀 Install Rust toolchain
+        uses: https://github.com/actions-rs/toolchain@v1
+        with:
+          toolchain: stable
+          components: rust-src
+          override: true
+
+      - name: 📦 Install Zig and cargo-zigbuild
+        if: steps.cache-tools.outputs.cache-hit != 'true'
+        run: |
+          mkdir -p /tmp/zig
+          curl -L https://ziglang.org/builds/zig-linux-x86_64-0.11.0.tar.xz | tar -xJ -C /tmp/zig --strip-components=1
+          curl -L https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
+          cargo binstall -y cargo-zigbuild
+
+  build:
+    name: 🏗️ Build ${{ matrix.target }}
+    needs: setup
+    runs-on: ubuntu-latest
     strategy:
       fail-fast: false
       matrix:
+        target:
+          - x86_64-unknown-linux-gnu
+          - aarch64-unknown-linux-gnu
+          - x86_64-pc-windows-msvc
         include:
           - target: x86_64-unknown-linux-gnu
-            container: messense/cargo-zigbuild:latest
             binary_name: zenyx-x86_64-linux
             ext: ""
-
           - target: aarch64-unknown-linux-gnu
-            container: messense/cargo-zigbuild:latest
             binary_name: zenyx-aarch64-linux
             ext: ""
-
-          - target: universal2-apple-darwin
-            container: messense/cargo-zigbuild:latest
-            binary_name: zenyx-universal-macos
-            ext: ""
-
           - target: x86_64-pc-windows-msvc
-            container: messense/cargo-xwin:latest
             binary_name: zenyx-x86_64-windows-msvc.exe
             ext: ".exe"
 
@@ -38,35 +64,42 @@ jobs:
       - name: 📥 Checkout source
         uses: https://github.com/actions/checkout@v4
 
-      - name: 🧩 Restore Cargo cache
+      - name: 🗄️ Restore tool cache
         uses: https://github.com/actions/cache@v4
         with:
           path: |
-            /usr/local/cargo/registry
-            /usr/local/cargo/git
-            target
-          key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
-          restore-keys: |
-            ${{ runner.os }}-cargo-${{ matrix.target }}-
+            ~/.cargo/bin
+            /tmp/zig
+          key: tools-v1-${{ hashFiles('**/Cargo.lock') }}
 
-      - name: 🦀 Install macOS targets
-        if: matrix.target == 'universal2-apple-darwin'
+      - name: 📍 Add Zig to PATH
+        run: echo "/tmp/zig" >> $GITHUB_PATH
+
+      - name: 🎯 Install Rust target
         uses: https://github.com/actions-rs/toolchain@v1
         with:
-          target: x86_64-apple-darwin,aarch64-apple-darwin
+          toolchain: stable
+          target: ${{ matrix.target }}
+          override: true
 
-      - name: 🚀 Build project
-        run: |
-          cargo zigbuild --target ${{ matrix.target }} --release
-        if: matrix.target != 'x86_64-pc-windows-msvc'
+      - name: 🗄️ Restore Cargo cache
+        uses: https://github.com/actions/cache@v4
+        with:
+          path: |
+            ~/.cargo/registry
+            ~/.cargo/git
+            target
+          key: cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
+          restore-keys: |
+            cargo-${{ matrix.target }}-
 
-      - name: 🚀 Build Windows project
-        run: |
-          cargo xwin build --target ${{ matrix.target }} --release
-        if: matrix.target == 'x86_64-pc-windows-msvc'
+      - name: 🚀 Build release binary
+        run: cargo zigbuild --target ${{ matrix.target }} --release
 
       - name: 📦 Package artifact
-        run: mkdir -p artifacts && cp target/${{ matrix.target }}/release/zenyx${{ matrix.ext }} artifacts/${{ matrix.binary_name }}
+        run: |
+          mkdir -p artifacts
+          cp target/${{ matrix.target }}/release/zenyx${{ matrix.ext }} artifacts/${{ matrix.binary_name }}
 
       - name: ⬆️ Upload artifact
         uses: https://code.forgejo.org/forgejo/upload-artifact@v4

From 971aad5414a83d32a2c103e69711d0e017be375a Mon Sep 17 00:00:00 2001
From: Chance <caznix01@gmail.com>
Date: Sat, 19 Apr 2025 00:05:31 -0400
Subject: [PATCH 3/3] wip: fix workflow

---
 .forgejo/workflows/build-release.yml | 53 ++++++++++------------------
 1 file changed, 18 insertions(+), 35 deletions(-)

diff --git a/.forgejo/workflows/build-release.yml b/.forgejo/workflows/build-release.yml
index e3d7f9e..a87f305 100644
--- a/.forgejo/workflows/build-release.yml
+++ b/.forgejo/workflows/build-release.yml
@@ -19,8 +19,9 @@ jobs:
         id: cache-tools
         with:
           path: |
-            ~/.cargo/bin
-            /tmp/zig
+            ~/.cargo/registry
+            ~/.cargo/git
+            target
           key: tools-v1-${{ hashFiles('**/Cargo.lock') }}
 
       - name: 🦀 Install Rust toolchain
@@ -30,14 +31,6 @@ jobs:
           components: rust-src
           override: true
 
-      - name: 📦 Install Zig and cargo-zigbuild
-        if: steps.cache-tools.outputs.cache-hit != 'true'
-        run: |
-          mkdir -p /tmp/zig
-          curl -L https://ziglang.org/builds/zig-linux-x86_64-0.11.0.tar.xz | tar -xJ -C /tmp/zig --strip-components=1
-          curl -L https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
-          cargo binstall -y cargo-zigbuild
-
   build:
     name: 🏗️ Build ${{ matrix.target }}
     needs: setup
@@ -45,56 +38,46 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        target:
-          - x86_64-unknown-linux-gnu
-          - aarch64-unknown-linux-gnu
-          - x86_64-pc-windows-msvc
         include:
           - target: x86_64-unknown-linux-gnu
+            image: messense/cargo-zigbuild:latest
             binary_name: zenyx-x86_64-linux
             ext: ""
+
           - target: aarch64-unknown-linux-gnu
+            image: messense/cargo-zigbuild:latest
             binary_name: zenyx-aarch64-linux
             ext: ""
+
           - target: x86_64-pc-windows-msvc
+            image: messense/cargo-xwin:latest
             binary_name: zenyx-x86_64-windows-msvc.exe
             ext: ".exe"
 
+    container: ${{ matrix.image }}
+
     steps:
       - name: 📥 Checkout source
         uses: https://github.com/actions/checkout@v4
 
-      - name: 🗄️ Restore tool cache
-        uses: https://github.com/actions/cache@v4
-        with:
-          path: |
-            ~/.cargo/bin
-            /tmp/zig
-          key: tools-v1-${{ hashFiles('**/Cargo.lock') }}
-
-      - name: 📍 Add Zig to PATH
-        run: echo "/tmp/zig" >> $GITHUB_PATH
-
-      - name: 🎯 Install Rust target
-        uses: https://github.com/actions-rs/toolchain@v1
-        with:
-          toolchain: stable
-          target: ${{ matrix.target }}
-          override: true
-
       - name: 🗄️ Restore Cargo cache
         uses: https://github.com/actions/cache@v4
         with:
           path: |
-            ~/.cargo/registry
-            ~/.cargo/git
+            /usr/local/cargo/registry
+            /usr/local/cargo/git
             target
           key: cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
           restore-keys: |
             cargo-${{ matrix.target }}-
 
       - name: 🚀 Build release binary
-        run: cargo zigbuild --target ${{ matrix.target }} --release
+        run: |
+          if [[ "${{ matrix.target }}" == *"windows"* ]]; then
+            cargo xwin build --target ${{ matrix.target }} --release
+          else
+            cargo zigbuild --target ${{ matrix.target }} --release
+          fi
 
       - name: 📦 Package artifact
         run: |