kitgit

tirbofish/dropbear · commit

32880881f7fe53cbc2bf3d531ebbfd95745e4d2d

Merge pull request #1 from 4tkbytes/github-actions-yaml ci: github actions

Unverified

tk <4tkbytes@pm.me> · 2025-07-29 05:02

view full diff

diff --git a/.github/workflows/create_executable.yaml b/.github/workflows/create_executable.yaml
new file mode 100644
index 0000000..ca2c678
--- /dev/null
+++ b/.github/workflows/create_executable.yaml
@@ -0,0 +1,92 @@
+
+name: Build Executables
+
+on:
+  push: {}
+  pull_request: {}
+
+jobs:
+  build:
+    name: Build for ${{ matrix.os_name }}
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        include:
+          - os: windows-latest
+            os_name: windows-x64
+            target: x86_64-pc-windows-msvc
+            ext: .exe
+            russimp_url: https://github.com/jkvargas/russimp-sys/releases/download/v2.0.3/russimp-2.0.3-x86_64-pc-windows-msvc-dylib.tar.gz
+            russimp_file: assimp.dll
+          - os: ubuntu-latest
+            os_name: linux-x64
+            target: x86_64-unknown-linux-gnu
+            ext: ""
+            russimp_url: https://github.com/jkvargas/russimp-sys/releases/download/v2.0.3/russimp-2.0.3-x86_64-unknown-linux-gnu-dylib.tar.gz
+            russimp_file: libassimp.so.5
+          - os: macos-latest
+            os_name: macos-arm64
+            target: aarch64-apple-darwin
+            ext: ""
+            russimp_url: https://github.com/jkvargas/russimp-sys/releases/download/v2.0.3/russimp-2.0.3-x86_64-apple-darwin-dylib.tar.gz
+            russimp_file: libassimp.5.dylib
+
+    steps:
+      - uses: actions/checkout@v4
+
+      - name: Install libudev-dev (Linux)
+        if: matrix.os == 'ubuntu-latest'
+        run: sudo apt-get update && sudo apt-get install -y libudev-dev
+
+      - name: Install assimp-utils (Linux)
+        if: matrix.os == 'ubuntu-latest'
+        run: sudo apt-get install -y assimp-utils
+
+      - name: Install assimp (macOS)
+        if: matrix.os == 'macos-latest'
+        run: brew install assimp
+
+      - name: Install Rust
+        uses: dtolnay/rust-toolchain@stable
+        with:
+          targets: ${{ matrix.target }}
+
+      - name: Build redback
+        run: cargo build --release --package redback --target ${{ matrix.target }}
+
+      - name: Build eucalyptus
+        run: cargo build --release --package eucalyptus --target ${{ matrix.target }}
+
+      - name: Download and extract russimp dynamic lib
+        run: |
+          curl -L -o russimp.tar.gz ${{ matrix.russimp_url }}
+          tar -xzf russimp.tar.gz
+        if: ${{ matrix.russimp_url != '' }}
+
+      - name: Prepare artifact
+        run: |
+          mkdir dist
+          cp target/${{ matrix.target }}/release/redback${{ matrix.ext }} dist/
+          cp target/${{ matrix.target }}/release/eucalyptus${{ matrix.ext }} dist/
+          if [ "${{ matrix.russimp_file }}" != "" ]; then
+            find . -name "${{ matrix.russimp_file }}" -exec cp {} dist/ \;
+          fi
+        shell: bash
+
+      - name: Archive artifact
+        run: |
+          set -e
+          if [ "${{ matrix.os }}" = "windows-latest" ]; then
+            powershell Compress-Archive -Path dist\* -DestinationPath executables-${{ matrix.os_name }}.zip
+          else
+            tar -czf executables-${{ matrix.os_name }}.tar.gz -C dist .
+          fi
+        shell: bash
+
+      - name: Upload artifact
+        uses: actions/upload-artifact@v4
+        with:
+          name: executables-${{ matrix.os_name }}
+          path: |
+            executables-${{ matrix.os_name }}.zip
+            executables-${{ matrix.os_name }}.tar.gz
\ No newline at end of file
diff --git a/Cargo.toml b/Cargo.toml
index 81a2ce6..c649159 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,3 +8,12 @@ debug = true
 codegen-units = 16
 incremental = true
 lto = false
+
+[profile.release]
+pt-level = "3"
+lto = true
+codegen-units = 1
+strip = true
+panic = "abort"
+debug = false
+incremental = false
diff --git a/dropbear-engine/Cargo.toml b/dropbear-engine/Cargo.toml
index 13348b2..fccc2e9 100644
--- a/dropbear-engine/Cargo.toml
+++ b/dropbear-engine/Cargo.toml
@@ -7,6 +7,7 @@ description = "A game engine made by 4tkbytes. Thats really it..."
 repository = "https://github.com/4tkbytes/dropbear-engine"
 readme = "../README.md"
 
+
 [dependencies]
 anyhow = "1.0.98"
 winit = { version = "0.30", features = ["android-native-activity"] }
@@ -21,7 +22,6 @@ bytemuck = { version = "1.23", features = ["derive"] }
 spin_sleep = "1.3"
 nalgebra = "0.33"
 num-traits = "0.2"
-russimp = { version = "3.2", features = ["prebuilt"] }
 egui = "0.32"
 egui-winit = "0.32"
 egui-wgpu = { version = "0.32", features = ["winit"] }
@@ -29,6 +29,12 @@ egui_extras = { version = "0.32", features = ["all_loaders"] }
 gilrs = "0.11"
 hecs = {version = "0.10", features = ["serde"]}
 
+[target.'cfg(any(target_arch = "aarch64", target_arch = "arm"))'.dependencies]
+russimp = "3.2"
+
+[target.'cfg(not(any(target_arch = "aarch64", target_arch = "arm")))'.dependencies]
+russimp = { version = "3.2", features = ["prebuilt"] }
+
 [dependencies.image]
 version = "0.25"
 default-features = false