From 9f2545c9ad7f2bc7ef5c53881742a8fec05c0177 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Jan 2026 11:33:39 +0000 Subject: [PATCH 1/6] Initial plan From e481cee8ac7d1906048a50c6b6f06052745b2016 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Jan 2026 11:37:24 +0000 Subject: [PATCH 2/6] Add GitHub Actions workflow for release builds (Linux & macOS) Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com> --- .github/workflows/release-builds.yml | 92 ++++++++++++++++++++++++++++ run.sh | 8 +++ 2 files changed, 100 insertions(+) create mode 100644 .github/workflows/release-builds.yml create mode 100755 run.sh diff --git a/.github/workflows/release-builds.yml b/.github/workflows/release-builds.yml new file mode 100644 index 0000000..2494632 --- /dev/null +++ b/.github/workflows/release-builds.yml @@ -0,0 +1,92 @@ +name: Release Builds + +on: + release: + types: [published] + +jobs: + build-linux: + name: Build Linux (amd64) + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Java 21 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + cache: 'maven' + + - name: Build with Maven + run: mvn clean package -DskipTests + + - name: Download FFmpeg for Linux + run: | + mkdir -p bin + wget -O ffmpeg.tar.xz https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz + tar -xf ffmpeg.tar.xz + mv ffmpeg-*-amd64-static/ffmpeg bin/ffmpeg + chmod +x bin/ffmpeg + rm -rf ffmpeg.tar.xz ffmpeg-*-amd64-static + + - name: Create release package + run: | + mkdir -p release/SpriteLab-Linux-amd64 + cp target/SpriteLab.jar release/SpriteLab-Linux-amd64/ + cp -r bin release/SpriteLab-Linux-amd64/ + cp run.sh release/SpriteLab-Linux-amd64/ + cp README.md release/SpriteLab-Linux-amd64/ || cp Readme.md release/SpriteLab-Linux-amd64/ || true + cp LICENSE release/SpriteLab-Linux-amd64/ || true + cd release + tar -czf SpriteLab-Linux-amd64.tar.gz SpriteLab-Linux-amd64 + + - name: Upload release asset + uses: softprops/action-gh-release@v1 + with: + files: ./release/SpriteLab-Linux-amd64.tar.gz + + build-macos: + name: Build macOS (arm64) + runs-on: macos-14 # macOS 14 runs on Apple Silicon (arm64) + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Java 21 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + cache: 'maven' + + - name: Build with Maven + run: mvn clean package -DskipTests + + - name: Download FFmpeg for macOS ARM64 + run: | + mkdir -p bin + # Download FFmpeg static build for macOS ARM64 + wget -O ffmpeg.zip https://evermeet.cx/ffmpeg/getrelease/ffmpeg/zip + unzip -j ffmpeg.zip -d bin/ + chmod +x bin/ffmpeg + rm ffmpeg.zip + + - name: Create release package + run: | + mkdir -p release/SpriteLab-macOS-arm64 + cp target/SpriteLab.jar release/SpriteLab-macOS-arm64/ + cp -r bin release/SpriteLab-macOS-arm64/ + cp run.sh release/SpriteLab-macOS-arm64/ + cp README.md release/SpriteLab-macOS-arm64/ || cp Readme.md release/SpriteLab-macOS-arm64/ || true + cp LICENSE release/SpriteLab-macOS-arm64/ || true + cd release + tar -czf SpriteLab-macOS-arm64.tar.gz SpriteLab-macOS-arm64 + + - name: Upload release asset + uses: softprops/action-gh-release@v1 + with: + files: ./release/SpriteLab-macOS-arm64.tar.gz diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..f0b4599 --- /dev/null +++ b/run.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# Launch script for SpriteLab on Linux/macOS + +# Get the directory where this script is located +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# Run SpriteLab with the correct Java version +java -jar "$SCRIPT_DIR/SpriteLab.jar" From ebb85e98dbbd7ba13790e3f1689fadea37bc5a0c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Jan 2026 11:38:14 +0000 Subject: [PATCH 3/6] Improve workflow and run script based on code review feedback Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com> --- .github/workflows/release-builds.yml | 4 ++-- run.sh | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-builds.yml b/.github/workflows/release-builds.yml index 2494632..d7bea3c 100644 --- a/.github/workflows/release-builds.yml +++ b/.github/workflows/release-builds.yml @@ -44,7 +44,7 @@ jobs: tar -czf SpriteLab-Linux-amd64.tar.gz SpriteLab-Linux-amd64 - name: Upload release asset - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: files: ./release/SpriteLab-Linux-amd64.tar.gz @@ -87,6 +87,6 @@ jobs: tar -czf SpriteLab-macOS-arm64.tar.gz SpriteLab-macOS-arm64 - name: Upload release asset - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: files: ./release/SpriteLab-macOS-arm64.tar.gz diff --git a/run.sh b/run.sh index f0b4599..f7eecdf 100755 --- a/run.sh +++ b/run.sh @@ -4,5 +4,25 @@ # Get the directory where this script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +# Check if Java is installed +if ! command -v java &> /dev/null; then + echo "Error: Java is not installed or not in PATH." + echo "Please install Java 21 or higher to run SpriteLab." + exit 1 +fi + +# Check if the JAR file exists +if [ ! -f "$SCRIPT_DIR/SpriteLab.jar" ]; then + echo "Error: SpriteLab.jar 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 + # Run SpriteLab with the correct Java version java -jar "$SCRIPT_DIR/SpriteLab.jar" + From de55595a5ec30684c31bd6bca2a44f1f23b0229f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Jan 2026 11:39:20 +0000 Subject: [PATCH 4/6] Add explicit permissions to workflow jobs for security Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com> --- .github/workflows/release-builds.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release-builds.yml b/.github/workflows/release-builds.yml index d7bea3c..00bba4b 100644 --- a/.github/workflows/release-builds.yml +++ b/.github/workflows/release-builds.yml @@ -8,6 +8,8 @@ jobs: build-linux: name: Build Linux (amd64) runs-on: ubuntu-latest + permissions: + contents: write # Required to upload release assets steps: - name: Checkout code @@ -51,6 +53,8 @@ jobs: build-macos: name: Build macOS (arm64) runs-on: macos-14 # macOS 14 runs on Apple Silicon (arm64) + permissions: + contents: write # Required to upload release assets steps: - name: Checkout code From b4725ac31bab4d23d112848c219041f728dadadc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Jan 2026 11:50:12 +0000 Subject: [PATCH 5/6] Refactor workflow to use GraalVM and staging pattern from reference example Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com> --- .github/workflows/release-builds.yml | 78 ++++++++++++++++------------ 1 file changed, 46 insertions(+), 32 deletions(-) diff --git a/.github/workflows/release-builds.yml b/.github/workflows/release-builds.yml index 00bba4b..35860f1 100644 --- a/.github/workflows/release-builds.yml +++ b/.github/workflows/release-builds.yml @@ -15,40 +15,47 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Set up Java 21 - uses: actions/setup-java@v4 + - name: Set up GraalVM + uses: graalvm/setup-graalvm@v1 with: - distribution: 'temurin' java-version: '21' + distribution: 'graalvm' + github-token: ${{ secrets.GITHUB_TOKEN }} + native-image-job-reports: 'true' cache: 'maven' - name: Build with Maven - run: mvn clean package -DskipTests + run: mvn -B clean package --file pom.xml - name: Download FFmpeg for Linux run: | - mkdir -p bin + mkdir -p staging/bin wget -O ffmpeg.tar.xz https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz tar -xf ffmpeg.tar.xz - mv ffmpeg-*-amd64-static/ffmpeg bin/ffmpeg - chmod +x bin/ffmpeg + mv ffmpeg-*-amd64-static/ffmpeg staging/bin/ffmpeg + chmod +x staging/bin/ffmpeg rm -rf ffmpeg.tar.xz ffmpeg-*-amd64-static + - name: Copy artifacts + run: | + cp target/SpriteLab.jar staging/SpriteLab-linux-amd64.jar + cp run.sh staging/ || true + cp README.md staging/ || cp Readme.md staging/ || true + cp LICENSE staging/ || true + - name: Create release package run: | - mkdir -p release/SpriteLab-Linux-amd64 - cp target/SpriteLab.jar release/SpriteLab-Linux-amd64/ - cp -r bin release/SpriteLab-Linux-amd64/ - cp run.sh release/SpriteLab-Linux-amd64/ - cp README.md release/SpriteLab-Linux-amd64/ || cp Readme.md release/SpriteLab-Linux-amd64/ || true - cp LICENSE release/SpriteLab-Linux-amd64/ || true - cd release - tar -czf SpriteLab-Linux-amd64.tar.gz SpriteLab-Linux-amd64 + cd staging + tar -czf SpriteLab-Linux-amd64.tar.gz * + mv SpriteLab-Linux-amd64.tar.gz .. - name: Upload release asset uses: softprops/action-gh-release@v2 with: - files: ./release/SpriteLab-Linux-amd64.tar.gz + files: SpriteLab-Linux-amd64.tar.gz + + - name: Clean staging + run: rm -fr staging build-macos: name: Build macOS (arm64) @@ -60,37 +67,44 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Set up Java 21 - uses: actions/setup-java@v4 + - name: Set up GraalVM + uses: graalvm/setup-graalvm@v1 with: - distribution: 'temurin' java-version: '21' + distribution: 'graalvm' + github-token: ${{ secrets.GITHUB_TOKEN }} + native-image-job-reports: 'true' cache: 'maven' - name: Build with Maven - run: mvn clean package -DskipTests + run: mvn -B clean package --file pom.xml - name: Download FFmpeg for macOS ARM64 run: | - mkdir -p bin + mkdir -p staging/bin # Download FFmpeg static build for macOS ARM64 wget -O ffmpeg.zip https://evermeet.cx/ffmpeg/getrelease/ffmpeg/zip - unzip -j ffmpeg.zip -d bin/ - chmod +x bin/ffmpeg + 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 README.md staging/ || cp Readme.md staging/ || true + cp LICENSE staging/ || true + - name: Create release package run: | - mkdir -p release/SpriteLab-macOS-arm64 - cp target/SpriteLab.jar release/SpriteLab-macOS-arm64/ - cp -r bin release/SpriteLab-macOS-arm64/ - cp run.sh release/SpriteLab-macOS-arm64/ - cp README.md release/SpriteLab-macOS-arm64/ || cp Readme.md release/SpriteLab-macOS-arm64/ || true - cp LICENSE release/SpriteLab-macOS-arm64/ || true - cd release - tar -czf SpriteLab-macOS-arm64.tar.gz SpriteLab-macOS-arm64 + cd staging + tar -czf SpriteLab-macOS-arm64.tar.gz * + mv SpriteLab-macOS-arm64.tar.gz .. - name: Upload release asset uses: softprops/action-gh-release@v2 with: - files: ./release/SpriteLab-macOS-arm64.tar.gz + files: SpriteLab-macOS-arm64.tar.gz + + - name: Clean staging + run: rm -fr staging From 9d3684b4c996eccf3b60fa11f1f7467cfc5bba8e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Jan 2026 11:55:48 +0000 Subject: [PATCH 6/6] Add CI workflow to validate builds on pull requests Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com> --- .github/workflows/ci-build.yml | 153 +++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 .github/workflows/ci-build.yml diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml new file mode 100644 index 0000000..9bfb7cf --- /dev/null +++ b/.github/workflows/ci-build.yml @@ -0,0 +1,153 @@ +name: CI Build + +on: + pull_request: + branches: [ main, master ] + push: + branches: [ main, master ] + paths: + - "src/**" + - "pom.xml" + - ".github/workflows/ci-build.yml" + - "run.sh" + +jobs: + build-linux: + name: Build and Test - Linux (amd64) + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up GraalVM + uses: graalvm/setup-graalvm@v1 + with: + java-version: '21' + distribution: 'graalvm' + github-token: ${{ secrets.GITHUB_TOKEN }} + cache: 'maven' + + - name: Build with Maven + run: mvn -B clean package --file pom.xml + + - name: Verify JAR was created + run: | + if [ ! -f target/SpriteLab.jar ]; then + echo "Error: SpriteLab.jar was not created" + exit 1 + fi + echo "Build successful: SpriteLab.jar created" + ls -lh target/SpriteLab.jar + + - name: Download FFmpeg for Linux + run: | + mkdir -p staging/bin + wget -O ffmpeg.tar.xz https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz + tar -xf ffmpeg.tar.xz + mv ffmpeg-*-amd64-static/ffmpeg staging/bin/ffmpeg + chmod +x staging/bin/ffmpeg + rm -rf ffmpeg.tar.xz ffmpeg-*-amd64-static + + - name: Verify FFmpeg + run: | + if [ ! -f staging/bin/ffmpeg ]; then + echo "Error: FFmpeg binary not found" + exit 1 + fi + ./staging/bin/ffmpeg -version | head -1 + + - name: Copy artifacts + run: | + cp target/SpriteLab.jar staging/SpriteLab-linux-amd64.jar + cp run.sh staging/ || true + cp README.md staging/ || cp Readme.md staging/ || true + cp LICENSE staging/ || true + + - name: Create test package + run: | + cd staging + tar -czf SpriteLab-Linux-amd64.tar.gz * + mv SpriteLab-Linux-amd64.tar.gz .. + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: SpriteLab-Linux-amd64 + path: SpriteLab-Linux-amd64.tar.gz + retention-days: 7 + + - name: Clean staging + run: rm -fr staging + + build-macos: + name: Build and Test - macOS (arm64) + runs-on: macos-14 # macOS 14 runs on Apple Silicon (arm64) + permissions: + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up GraalVM + uses: graalvm/setup-graalvm@v1 + with: + java-version: '21' + distribution: 'graalvm' + github-token: ${{ secrets.GITHUB_TOKEN }} + cache: 'maven' + + - name: Build with Maven + run: mvn -B clean package --file pom.xml + + - name: Verify JAR was created + run: | + if [ ! -f target/SpriteLab.jar ]; then + echo "Error: SpriteLab.jar was not created" + exit 1 + fi + echo "Build successful: SpriteLab.jar created" + ls -lh target/SpriteLab.jar + + - name: Download FFmpeg for macOS ARM64 + run: | + mkdir -p staging/bin + # Download FFmpeg static build for macOS ARM64 + 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: Verify FFmpeg + run: | + if [ ! -f staging/bin/ffmpeg ]; then + echo "Error: FFmpeg binary not found" + exit 1 + fi + ./staging/bin/ffmpeg -version | head -1 + + - name: Copy artifacts + run: | + cp target/SpriteLab.jar staging/SpriteLab-macos-arm64.jar + cp run.sh staging/ || true + cp README.md staging/ || cp Readme.md staging/ || true + cp LICENSE staging/ || true + + - name: Create test package + run: | + cd staging + tar -czf SpriteLab-macOS-arm64.tar.gz * + mv SpriteLab-macOS-arm64.tar.gz .. + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: SpriteLab-macOS-arm64 + path: SpriteLab-macOS-arm64.tar.gz + retention-days: 7 + + - name: Clean staging + run: rm -fr staging