diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 9bfb7cf..c45c66c 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -30,7 +30,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} cache: 'maven' - - name: Build with Maven + - name: Build JAR with Maven run: mvn -B clean package --file pom.xml - name: Verify JAR was created @@ -39,8 +39,21 @@ jobs: echo "Error: SpriteLab.jar was not created" exit 1 fi - echo "Build successful: SpriteLab.jar created" + echo "JAR build successful: SpriteLab.jar created" ls -lh target/SpriteLab.jar + + - name: Build Native Binary with Maven + run: mvn -B -Pnative clean package --file pom.xml + + - name: Verify native binary was created + run: | + if [ ! -f target/SpriteLab ]; then + echo "Error: Native binary SpriteLab was not created" + exit 1 + fi + echo "Native binary created successfully" + ls -lh target/SpriteLab + file target/SpriteLab - name: Download FFmpeg for Linux run: | @@ -61,10 +74,11 @@ jobs: - name: Copy artifacts run: | - cp target/SpriteLab.jar staging/SpriteLab-linux-amd64.jar - cp run.sh staging/ || true + cp target/SpriteLab staging/SpriteLab + cp run-native.sh staging/ || true cp README.md staging/ || cp Readme.md staging/ || true cp LICENSE staging/ || true + chmod +x staging/SpriteLab staging/run-native.sh || true - name: Create test package run: | @@ -100,7 +114,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} cache: 'maven' - - name: Build with Maven + - name: Build JAR with Maven run: mvn -B clean package --file pom.xml - name: Verify JAR was created @@ -109,13 +123,28 @@ jobs: echo "Error: SpriteLab.jar was not created" exit 1 fi - echo "Build successful: SpriteLab.jar created" + echo "JAR build successful: SpriteLab.jar created" ls -lh target/SpriteLab.jar + + - name: Build Native Binary with Maven + run: mvn -B -Pnative clean package --file pom.xml + + - name: Verify native binary was created + run: | + if [ ! -f target/SpriteLab ]; then + echo "Error: Native binary SpriteLab was not created" + exit 1 + fi + echo "Native binary created successfully" + ls -lh target/SpriteLab + file target/SpriteLab - name: Download FFmpeg for macOS ARM64 run: | mkdir -p staging/bin # Download FFmpeg static build for macOS ARM64 + # Note: This URL redirects to the latest version. For production use, + # consider pinning to a specific version URL with checksum verification. curl -L -o ffmpeg.zip https://evermeet.cx/ffmpeg/getrelease/ffmpeg/zip unzip -j ffmpeg.zip -d staging/bin/ chmod +x staging/bin/ffmpeg @@ -131,10 +160,11 @@ jobs: - name: Copy artifacts run: | - cp target/SpriteLab.jar staging/SpriteLab-macos-arm64.jar - cp run.sh staging/ || true + cp target/SpriteLab staging/SpriteLab + cp run-native.sh staging/ || true cp README.md staging/ || cp Readme.md staging/ || true cp LICENSE staging/ || true + chmod +x staging/SpriteLab staging/run-native.sh || true - name: Create test package run: | diff --git a/.github/workflows/release-builds.yml b/.github/workflows/release-builds.yml index 35860f1..5c07598 100644 --- a/.github/workflows/release-builds.yml +++ b/.github/workflows/release-builds.yml @@ -24,9 +24,19 @@ jobs: native-image-job-reports: 'true' cache: 'maven' - - name: Build with Maven - run: mvn -B clean package --file pom.xml + - name: Build Native Binary with Maven + run: mvn -B -Pnative clean package --file pom.xml + - name: Verify native binary was created + run: | + if [ ! -f target/SpriteLab ]; then + echo "Error: Native binary SpriteLab was not created" + exit 1 + fi + echo "Native binary created successfully" + ls -lh target/SpriteLab + file target/SpriteLab + - name: Download FFmpeg for Linux run: | mkdir -p staging/bin @@ -38,10 +48,11 @@ jobs: - name: Copy artifacts run: | - cp target/SpriteLab.jar staging/SpriteLab-linux-amd64.jar - cp run.sh staging/ || true + cp target/SpriteLab staging/SpriteLab + cp run-native.sh staging/ || true cp README.md staging/ || cp Readme.md staging/ || true cp LICENSE staging/ || true + chmod +x staging/SpriteLab staging/run-native.sh || true - name: Create release package run: | @@ -76,24 +87,37 @@ jobs: native-image-job-reports: 'true' cache: 'maven' - - name: Build with Maven - run: mvn -B clean package --file pom.xml + - name: Build Native Binary with Maven + run: mvn -B -Pnative clean package --file pom.xml + - name: Verify native binary was created + run: | + if [ ! -f target/SpriteLab ]; then + echo "Error: Native binary SpriteLab was not created" + exit 1 + fi + echo "Native binary created successfully" + ls -lh target/SpriteLab + file target/SpriteLab + - name: Download FFmpeg for macOS ARM64 run: | mkdir -p staging/bin # Download FFmpeg static build for macOS ARM64 - wget -O ffmpeg.zip https://evermeet.cx/ffmpeg/getrelease/ffmpeg/zip + # Note: This URL redirects to the latest version. For production use, + # consider pinning to a specific version URL with checksum verification. + curl -L -o ffmpeg.zip https://evermeet.cx/ffmpeg/getrelease/ffmpeg/zip unzip -j ffmpeg.zip -d staging/bin/ chmod +x staging/bin/ffmpeg rm ffmpeg.zip - name: Copy artifacts run: | - cp target/SpriteLab.jar staging/SpriteLab-macos-arm64.jar - cp run.sh staging/ || true + cp target/SpriteLab staging/SpriteLab + cp run-native.sh staging/ || true cp README.md staging/ || cp Readme.md staging/ || true cp LICENSE staging/ || true + chmod +x staging/SpriteLab staging/run-native.sh || true - name: Create release package run: | diff --git a/Readme.md b/Readme.md index 5030234..6db8990 100644 --- a/Readme.md +++ b/Readme.md @@ -59,7 +59,25 @@ This tool is built for **creators**. It serves as the ideal bridge for: --- -## Installation (RAR Release) +## Installation + +### Binary Releases (Recommended - No Java Required) + +Native binary releases are available for Linux and macOS from the [GitHub Releases](https://github.com/katamini/SpriteLab/releases) page. These are standalone executables that **do not require Java** to be installed. + +**Linux (amd64):** +1. Download `SpriteLab-Linux-amd64.tar.gz` from the latest release +2. Extract: `tar -xzf SpriteLab-Linux-amd64.tar.gz` +3. Run: `./run-native.sh` or `./SpriteLab` + +**macOS (arm64/Apple Silicon):** +1. Download `SpriteLab-macOS-arm64.tar.gz` from the latest release +2. Extract: `tar -xzf SpriteLab-macOS-arm64.tar.gz` +3. Run: `./run-native.sh` or `./SpriteLab` + +Both packages include FFmpeg binaries in the `bin` folder. + +### Alternative Installation (RAR Release - Windows) 1. Download the `.rar` file from [Itch.io](https://fedeiatech.itch.io/spritelab). 2. Extract the contents (Ensure the `bin` folder containing `ffmpeg.exe` is in the same directory). @@ -73,4 +91,14 @@ This tool is built for **creators**. It serves as the ideal bridge for: * **Dependencies:** FFmpeg (Local binaries required in `/bin`). * **License:** MIT. +**Building from source:** + +```bash +# Build JAR (requires Java 21) +mvn clean package + +# Build native binary (requires GraalVM 21 with native-image) +mvn -Pnative clean package +``` + Developed by **FedeiaTech**. \ No newline at end of file diff --git a/pom.xml b/pom.xml index c00bd59..1942d4f 100644 --- a/pom.xml +++ b/pom.xml @@ -15,6 +15,7 @@ 21.0.1 11.2.1 com.fedeiatech.spritelab.Launcher + 0.10.3 @@ -81,4 +82,33 @@ + + + + native + + + + org.graalvm.buildtools + native-maven-plugin + ${native.maven.plugin.version} + true + + + build-native + + compile-no-fork + + package + + + + SpriteLab + ${exec.mainClass} + + + + + + \ No newline at end of file diff --git a/run-native.sh b/run-native.sh new file mode 100755 index 0000000..19ca82b --- /dev/null +++ b/run-native.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# Launch script for SpriteLab native binary on Linux/macOS + +# Get the directory where this script is located +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# Check if the native binary exists +if [ ! -f "$SCRIPT_DIR/SpriteLab" ]; then + echo "Error: SpriteLab binary not found in $SCRIPT_DIR" + exit 1 +fi + +# Check if FFmpeg binary exists +if [ ! -f "$SCRIPT_DIR/bin/ffmpeg" ]; then + echo "Warning: FFmpeg binary not found in $SCRIPT_DIR/bin/" + echo "SpriteLab requires FFmpeg to function properly." +fi + +# Make sure the binary is executable +chmod +x "$SCRIPT_DIR/SpriteLab" + +# Run SpriteLab native binary +"$SCRIPT_DIR/SpriteLab" "$@" diff --git a/src/main/resources/META-INF/native-image/com.fedeiatech.spritelab/SpriteLab/native-image.properties b/src/main/resources/META-INF/native-image/com.fedeiatech.spritelab/SpriteLab/native-image.properties new file mode 100644 index 0000000..a20862a --- /dev/null +++ b/src/main/resources/META-INF/native-image/com.fedeiatech.spritelab/SpriteLab/native-image.properties @@ -0,0 +1,4 @@ +Args = --no-fallback \ + --report-unsupported-elements-at-runtime \ + -H:+ReportExceptionStackTraces \ + --initialize-at-run-time=com.sun.javafx.application.PlatformImpl,org.controlsfx diff --git a/src/main/resources/META-INF/native-image/com.fedeiatech.spritelab/SpriteLab/reflect-config.json b/src/main/resources/META-INF/native-image/com.fedeiatech.spritelab/SpriteLab/reflect-config.json new file mode 100644 index 0000000..00e758c --- /dev/null +++ b/src/main/resources/META-INF/native-image/com.fedeiatech.spritelab/SpriteLab/reflect-config.json @@ -0,0 +1,39 @@ +[ + { + "name": "com.fedeiatech.spritelab.App", + "allDeclaredConstructors": true, + "allPublicConstructors": true, + "allDeclaredMethods": true, + "allPublicMethods": true + }, + { + "name": "com.fedeiatech.spritelab.Launcher", + "allDeclaredConstructors": true, + "allPublicConstructors": true, + "allDeclaredMethods": true, + "allPublicMethods": true + }, + { + "name": "com.fedeiatech.spritelab.PrimaryController", + "allDeclaredConstructors": true, + "allPublicConstructors": true, + "allDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredFields": true, + "allPublicFields": true + }, + { + "name": "com.fedeiatech.spritelab.FFmpegService", + "allDeclaredConstructors": true, + "allPublicConstructors": true, + "allDeclaredMethods": true, + "allPublicMethods": true + }, + { + "name": "javafx.fxml.FXMLLoader", + "allDeclaredConstructors": true, + "allPublicConstructors": true, + "allDeclaredMethods": true, + "allPublicMethods": true + } +] diff --git a/src/main/resources/META-INF/native-image/com.fedeiatech.spritelab/SpriteLab/resource-config.json b/src/main/resources/META-INF/native-image/com.fedeiatech.spritelab/SpriteLab/resource-config.json new file mode 100644 index 0000000..5dec1e9 --- /dev/null +++ b/src/main/resources/META-INF/native-image/com.fedeiatech.spritelab/SpriteLab/resource-config.json @@ -0,0 +1,16 @@ +{ + "resources": { + "includes": [ + { + "pattern": "\\Qcom/fedeiatech/spritelab/primary.fxml\\E" + }, + { + "pattern": "\\Qcom/fedeiatech/spritelab/styles.css\\E" + }, + { + "pattern": "\\Qcom/fedeiatech/spritelab/img/link.png\\E" + } + ] + }, + "bundles": [] +}