diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d5732de..28fa062 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,7 +51,8 @@ jobs: - name: Build Docker image uses: docker/build-push-action@v6 with: - context: docker/${{ matrix.platform.os }} + context: . + file: docker/${{ matrix.platform.os }}/Dockerfile build-args: | ARCH=${{ matrix.platform.arch }} tags: vanilla-${{ matrix.platform.os }}-${{ matrix.platform.arch }} @@ -64,7 +65,6 @@ jobs: docker run \ -v "${{ github.workspace }}:/vanilla" \ -v "${{ github.workspace }}/build:/install" \ - -e ANDROID_SIGNING_KEY=${{ secrets.ANDROID_SIGNING_KEY }} \ vanilla-${{ matrix.platform.os }}-${{ matrix.platform.arch }} - name: Archive (Linux) @@ -81,7 +81,17 @@ jobs: - name: Archive (Android) if: ${{ matrix.platform.os == 'android' }} run: | - cp build/app-release.apk ${{ matrix.platform.artifact }} + if [ -n "${{ secrets.ANDROID_SIGNING_KEY }}" ]; then + docker run \ + -v "${{ github.workspace }}:/vanilla" \ + -v "${{ github.workspace }}/build:/install" \ + --entrypoint apksigner \ + vanilla-${{ matrix.platform.os }}-${{ matrix.platform.arch }} \ + sign --ks /vanilla/docker/android/vanilla.jks --out /install/app-release-signed.apk --ks-pass pass:${{ secrets.ANDROID_SIGNING_KEY }} /install/app-release.apk + cp build/app-release-signed.apk ${{ matrix.platform.artifact }} + else + cp build/app-release.apk ${{ matrix.platform.artifact }} + fi - name: Upload a Build Artifact uses: actions/upload-artifact@v4 diff --git a/buildroot/configs/vanilla_nx_defconfig b/buildroot/configs/vanilla_nintendoswitch_defconfig similarity index 100% rename from buildroot/configs/vanilla_nx_defconfig rename to buildroot/configs/vanilla_nintendoswitch_defconfig diff --git a/docker/README.md b/docker/README.md index e540f0e..3e458d9 100644 --- a/docker/README.md +++ b/docker/README.md @@ -4,10 +4,10 @@ Since Vanilla's infrastructure can be somewhat complicated (and to aid in auto-b Usage is as follows for all platforms: -- First, build the Docker image. We give it the tag `vanilla-build:latest` but you can choose anything. +- First, build the Docker image. We give it the tag `vanilla-build:latest` but you can choose anything. Vanilla's Dockerfiles are designed to be run from the context of the source code root, so `cd` there and type the following command: ``` - docker build -t vanilla-build:latest . + docker build -f docker//Dockerfile -t vanilla-build:latest . ``` - Secondly, use the new Docker image to build. Two volumes must be mounted, `/vanilla` for the source directory, and `/install` for the final compiled file structure. The following paths (`~/vanilla-src` and `~/vanilla-build`) are provided as an example, but you should select paths that make the most sense on your system. @@ -16,4 +16,4 @@ Usage is as follows for all platforms: docker run -v ~/vanilla-src:/vanilla -v ~/vanilla-build:/install vanilla-build:latest ``` -Docker should succeed, and the end result should be a ready-to-use application. \ No newline at end of file +Docker should succeed, and the end result should be a ready-to-use application. diff --git a/docker/android/build.sh b/docker/android/build.sh index e8ba82a..53355f2 100755 --- a/docker/android/build.sh +++ b/docker/android/build.sh @@ -2,13 +2,4 @@ set -e cd /vanilla/android ./gradlew -PbuildDir=/build assembleRelease -zipalign -v -p 4 /build/outputs/apk/release/app-release-unsigned.apk /build/outputs/apk/release/app-release-unsigned-aligned.apk - -# If signing key is available, sign the APK -if [ -n "$ANDROID_SIGNING_KEY" ] -then - apksigner sign --ks /vanilla/docker/android/vanilla.jks --out /install/app-release.apk --ks-pass pass:$ANDROID_SIGNING_KEY /build/outputs/apk/release/app-release-unsigned-aligned.apk -else - # Otherwise, copy into the location expected by other scripts - cp /build/outputs/apk/release/app-release-unsigned-aligned.apk /install/app-release.apk -fi +zipalign -v -p 4 /build/outputs/apk/release/app-release-unsigned.apk /install/app-release.apk diff --git a/docker/nintendoswitch/Dockerfile b/docker/nintendoswitch/Dockerfile index 4074911..6f247a6 100644 --- a/docker/nintendoswitch/Dockerfile +++ b/docker/nintendoswitch/Dockerfile @@ -46,4 +46,19 @@ RUN git clone --branch 2025.11-rc2 https://github.com/buildroot/buildroot.git /b ENV FORCE_UNSAFE_CONFIGURE=1 +# Patch Buildroot to build an older version of X11 because the Tegra BSP isn't compatible with the newer one +COPY buildroot/package/x11r7/* /buildroot/package/x11r7/xserver_xorg-server/ + +# Build everything except for Vanilla +COPY buildroot /vanilla/buildroot +RUN make -C /buildroot O=/build BR2_EXTERNAL=/vanilla/buildroot vanilla_nintendoswitch_defconfig && \ + /buildroot/utils/config --file /build/.config -d BR2_PACKAGE_VANILLA && \ + make -C /buildroot O=/build && \ + /buildroot/utils/config --file /build/.config -e BR2_PACKAGE_VANILLA && \ + /buildroot/utils/config --file /build/.config -d BR2_PACKAGE_VANILLA_USE_VAAPI && \ + /buildroot/utils/config --file /build/.config -d BR2_PACKAGE_VANILLA_USE_DRM && \ + /buildroot/utils/config --file /build/.config -e BR2_PACKAGE_VANILLA_USE_NX_IMU && \ + /buildroot/utils/config --file /build/.config -e BR2_PACKAGE_VANILLA_USE_LOCAL && \ + /buildroot/utils/config --file /build/.config --set-str BR2_PACKAGE_VANILLA_LOCAL_PATH /vanilla + ENTRYPOINT [ "/vanilla/docker/nintendoswitch/build.sh" ] diff --git a/docker/nintendoswitch/build.sh b/docker/nintendoswitch/build.sh index 02e343f..2a7f32b 100755 --- a/docker/nintendoswitch/build.sh +++ b/docker/nintendoswitch/build.sh @@ -2,13 +2,7 @@ set -e -# Patch Buildroot to build an older version of X11 because the Tegra BSP isn't compatible with the newer one -cp /vanilla/buildroot/package/x11r7/* /buildroot/package/x11r7/xserver_xorg-server/ - # Main build -make -C /buildroot O=/build BR2_EXTERNAL=/vanilla/buildroot vanilla_nx_defconfig -/buildroot/utils/config --file /build/.config -e BR2_PACKAGE_VANILLA_USE_LOCAL -/buildroot/utils/config --file /build/.config --set-str BR2_PACKAGE_VANILLA_LOCAL_PATH /vanilla make -C /buildroot O=/build # Copy initramfs diff --git a/docker/raspberrypi0w/Dockerfile b/docker/raspberrypi0w/Dockerfile index 93dd33b..dad53ac 100644 --- a/docker/raspberrypi0w/Dockerfile +++ b/docker/raspberrypi0w/Dockerfile @@ -38,4 +38,13 @@ RUN git clone --depth 1 --branch 2025.11-rc2 https://github.com/buildroot/buildr ENV FORCE_UNSAFE_CONFIGURE=1 +# Build everything except for Vanilla +COPY buildroot /vanilla/buildroot +RUN make -C /buildroot O=/build BR2_EXTERNAL=/vanilla/buildroot vanilla_raspberrypi0w_defconfig && \ + /buildroot/utils/config --file /build/.config -d BR2_PACKAGE_VANILLA && \ + make -C /buildroot O=/build && \ + /buildroot/utils/config --file /build/.config -e BR2_PACKAGE_VANILLA && \ + /buildroot/utils/config --file /build/.config -e BR2_PACKAGE_VANILLA_USE_LOCAL && \ + /buildroot/utils/config --file /build/.config --set-str BR2_PACKAGE_VANILLA_LOCAL_PATH /vanilla + ENTRYPOINT [ "/vanilla/docker/raspberrypi0w/build.sh" ] diff --git a/docker/raspberrypi0w/build.sh b/docker/raspberrypi0w/build.sh index 2febf23..fb13db2 100755 --- a/docker/raspberrypi0w/build.sh +++ b/docker/raspberrypi0w/build.sh @@ -2,9 +2,6 @@ set -e -make -C /buildroot O=/build BR2_EXTERNAL=/vanilla/buildroot vanilla_raspberrypi0w_defconfig -/buildroot/utils/config --file /build/.config -e BR2_PACKAGE_VANILLA_USE_LOCAL -/buildroot/utils/config --file /build/.config --set-str BR2_PACKAGE_VANILLA_LOCAL_PATH /vanilla make -C /buildroot O=/build cd /build/images diff --git a/docker/raspberrypizero2w/Dockerfile b/docker/raspberrypizero2w/Dockerfile index 4b18d6c..fb79e6b 100644 --- a/docker/raspberrypizero2w/Dockerfile +++ b/docker/raspberrypizero2w/Dockerfile @@ -38,4 +38,13 @@ RUN git clone --depth 1 --branch 2025.11-rc2 https://github.com/buildroot/buildr ENV FORCE_UNSAFE_CONFIGURE=1 +# Build everything except for Vanilla +COPY buildroot /vanilla/buildroot +RUN make -C /buildroot O=/build BR2_EXTERNAL=/vanilla/buildroot vanilla_raspberrypizero2w_64_defconfig && \ + /buildroot/utils/config --file /build/.config -d BR2_PACKAGE_VANILLA && \ + make -C /buildroot O=/build && \ + /buildroot/utils/config --file /build/.config -e BR2_PACKAGE_VANILLA && \ + /buildroot/utils/config --file /build/.config -e BR2_PACKAGE_VANILLA_USE_LOCAL && \ + /buildroot/utils/config --file /build/.config --set-str BR2_PACKAGE_VANILLA_LOCAL_PATH /vanilla + ENTRYPOINT [ "/vanilla/docker/raspberrypizero2w/build.sh" ] diff --git a/docker/raspberrypizero2w/build.sh b/docker/raspberrypizero2w/build.sh index 95250e8..fb13db2 100755 --- a/docker/raspberrypizero2w/build.sh +++ b/docker/raspberrypizero2w/build.sh @@ -2,9 +2,6 @@ set -e -make -C /buildroot O=/build BR2_EXTERNAL=/vanilla/buildroot vanilla_raspberrypizero2w_64_defconfig -/buildroot/utils/config --file /build/.config -e BR2_PACKAGE_VANILLA_USE_LOCAL -/buildroot/utils/config --file /build/.config --set-str BR2_PACKAGE_VANILLA_LOCAL_PATH /vanilla make -C /buildroot O=/build cd /build/images diff --git a/docker/windows/Dockerfile b/docker/windows/Dockerfile index dbec360..91fc774 100644 --- a/docker/windows/Dockerfile +++ b/docker/windows/Dockerfile @@ -15,6 +15,6 @@ RUN wget https://github.com/Kitware/CMake/releases/download/v$CMAKE_VER/cmake-$C && chmod +x cmake-$CMAKE_VER-linux-$(uname -m).sh \ && ./cmake-$CMAKE_VER-linux-$(uname -m).sh --prefix=/usr --skip-license -COPY "mingw-w64-x86_64.cmake" "/" +COPY "docker/windows/mingw-w64-x86_64.cmake" "/" ENTRYPOINT [ "/vanilla/docker/windows/build.sh" ]