From 1800e0739e821f56fd68cb7ed6a77d01a437fd48 Mon Sep 17 00:00:00 2001 From: MightyElemental <12786983+MightyElemental@users.noreply.github.com> Date: Wed, 4 Feb 2026 18:21:35 +0000 Subject: [PATCH 01/10] Corrected shebang to use bash instead of sh --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 7de2b4a..0f57725 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash sdk_name=renpy-$1-sdk echo "Downloading the specified SDK (${sdk_name})..." From f39fe5ddc3b276036453cdd8a641652b19e72e3c Mon Sep 17 00:00:00 2001 From: MightyElemental <12786983+MightyElemental@users.noreply.github.com> Date: Thu, 5 Feb 2026 10:07:05 +0000 Subject: [PATCH 02/10] [renpy-build] Fixed install_lib function - Changed echo statement to reflect what library is actually being added, not just "Steam" - Quoted variable expansions. This prevents word-splitting and pathname expansion when name contains spaces or glob characters. - Removed "clear" command so we can actually review the output - Added missing ".zip" extension to the file name being unzipped - Removed "Downloaded..." statement as the "Adding..." statement serves the same purpose - Added an echo to the end of the function to notify when it has completed --- build.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/build.sh b/build.sh index 0f57725..00d960a 100755 --- a/build.sh +++ b/build.sh @@ -17,15 +17,14 @@ install_lib() { lib="$2" name="renpy-$version-$lib" - echo "Downloading ${lib} lib (${name})..." + echo "Downloading '${lib}' lib (${name})..." wget -q "https://www.renpy.org/dl/${version}/${name}.zip" - clear - echo "Downloaded ${lib} lib (${name})..." - echo "Adding Steam lib to Renpy" - unzip -qq ./${name} -d ${name} - rsync -a ${name}/ ../renpy - rm -rf ${name} ${name}.zip + echo "Adding '${lib}' lib to Renpy..." + unzip -qq "./${name}.zip" -d "${name}" + rsync -a "${name}/" ../renpy + rm -rf "${name}" "${name}.zip" + echo "Added '${lib}' lib (${name})..." } if [ $4 = "true" ]; then From ba5d995567a7e525487b5e792fea515d637a4865 Mon Sep 17 00:00:00 2001 From: MightyElemental <12786983+MightyElemental@users.noreply.github.com> Date: Thu, 5 Feb 2026 11:01:09 +0000 Subject: [PATCH 03/10] [renpy-build] Changed initial echo statements - Removed redundant echo statement - Removed "clear" function call - Added echo statement to indicate when the setup is complete --- build.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 00d960a..af7e63e 100755 --- a/build.sh +++ b/build.sh @@ -3,13 +3,12 @@ sdk_name=renpy-$1-sdk echo "Downloading the specified SDK (${sdk_name})..." wget -q https://www.renpy.org/dl/$1/${sdk_name}.tar.bz2 -clear -echo "Downloaded SDK version (${sdk_name})." echo "Setting up the specified SDK (${sdk_name})..." tar -xf ./${sdk_name}.tar.bz2 rm ./${sdk_name}.tar.bz2 mv ./${sdk_name} ../renpy +echo "Setup SDK version (${sdk_name})." # used for steam and web install_lib() { From 2c0aabb475c4d9fcc533cb4aec00f35db4505125 Mon Sep 17 00:00:00 2001 From: MightyElemental <12786983+MightyElemental@users.noreply.github.com> Date: Thu, 5 Feb 2026 11:14:25 +0000 Subject: [PATCH 04/10] [renpy-build] Fixed platform build logic - Separated into a dedicated function, build_platform - Removed duplicate code - Fixed code to allow an array of target platforms (e.g. "pc" or "pc mac web"). This will default to building all platforms if the variable is unset or has an invalid value. --- build.sh | 76 +++++++++++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/build.sh b/build.sh index af7e63e..07b52bd 100755 --- a/build.sh +++ b/build.sh @@ -26,44 +26,19 @@ install_lib() { echo "Added '${lib}' lib (${name})..." } -if [ $4 = "true" ]; then - install_lib "$1" steam -fi - -# Note: This will be checked regardless of the version of Ren'Py. Caution is -# advised. -if [ -d "$2/old-game" ]; then - echo "old-game directory detected." - if [ -z "$(ls -A "$2/old-game")" ]; then - echo "ERROR: old-game is empty. This will cause incompatibility issues." - echo "For more information on how the old-game directory works and why" - echo "this directory should not be empty, please refer to the documentation" - echo "at: https://www.renpy.org/doc/html/build.html#old-game." - exit 1 - fi -fi - -if [[ "$(declare -p -- "$3")" == "declare -a "* ]]; then - for i in "${3[@]}" - do - if [ $i == 'android' ]; then - COMMAND="../renpy/renpy.sh ../renpy/launcher android_build $2" - elif [ $i == 'web' ]; then - install_lib "$1" web - COMMAND="../renpy/renpy.sh ../renpy/launcher web_build $2" - else - COMMAND="../renpy/renpy.sh ../renpy/launcher distribute --package $i $2" - fi - echo "Building $i" - if $COMMAND; then - built_dir=$(ls | grep '\-dists') - echo dir=$built_dir >> $GITHUB_OUTPUT - echo version=${built_dir%'-dists'} >> $GITHUB_OUTPUT - else - return 1 - fi - done -else +# Builds a Ren'Py distribution for a target platform +# +# Args: +# $1: Version +# $2: Project path +# $3: Target platform (pc|win|mac|linux|market|web|android). Default: All. +# +# Outputs: +# Writes `dir` and `version` to $GITHUB_OUTPUT on success +# +# Returns: +# 0 on success; non-zero on failure. +build_platform() { case $3 in pc|win|mac|linux|market) COMMAND="../renpy/renpy.sh ../renpy/launcher distribute --package $3 $2" @@ -80,7 +55,7 @@ else ;; esac - echo "Building the project at $2..." + echo "Building the project for platform '$3' at '$2'..." if $COMMAND; then built_dir=$(ls | grep '\-dists') echo dir=$built_dir >> $GITHUB_OUTPUT @@ -88,5 +63,28 @@ else else return 1 fi +} + +if [ $4 = "true" ]; then + install_lib "$1" steam fi +# Note: This will be checked regardless of the version of Ren'Py. Caution is advised. +if [ -d "$2/old-game" ]; then + echo "old-game directory detected." + if [ -z "$(ls -A "$2/old-game")" ]; then + echo "ERROR: old-game is empty. This will cause incompatibility issues." + echo "For more information on how the old-game directory works and why" + echo "this directory should not be empty, please refer to the documentation" + echo "at: https://www.renpy.org/doc/html/build.html#old-game." + exit 1 + fi +fi + +# Split $3 into an array of target platforms +[[ -n ${3-} ]] && read -r -a target_platforms <<<"$3" || target_platforms=("all") + +# Build for listed platforms +for i in "${target_platforms[@]}"; do + build_platform "$1" "$2" "$i" +done From 06665eb4b12d4a8f6bcb304ae07dfefd2be0bd31 Mon Sep 17 00:00:00 2001 From: MightyElemental <12786983+MightyElemental@users.noreply.github.com> Date: Thu, 5 Feb 2026 11:34:38 +0000 Subject: [PATCH 05/10] [renpy-build] Improved command safety - Quoted case input to avoid word splitting/globbing - Build COMMAND as a bash array (argv) instead of a string to preserve argument boundaries - Make dist lookup single-valued. use `ls -1` and `grep -m1 -- '-dists$'` to select the first match - Quote key=value writes to $GITHUB_OUTPUT --- build.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/build.sh b/build.sh index 07b52bd..533976d 100755 --- a/build.sh +++ b/build.sh @@ -39,27 +39,27 @@ install_lib() { # Returns: # 0 on success; non-zero on failure. build_platform() { - case $3 in + case "$3" in pc|win|mac|linux|market) - COMMAND="../renpy/renpy.sh ../renpy/launcher distribute --package $3 $2" + COMMAND=(../renpy/renpy.sh ../renpy/launcher distribute --package "$3" "$2") ;; web) install_lib "$1" web - COMMAND="../renpy/renpy.sh ../renpy/launcher web_build $2" + COMMAND=(../renpy/renpy.sh ../renpy/launcher web_build "$2") ;; android) - COMMAND="../renpy/renpy.sh ../renpy/launcher android_build $2" + COMMAND=(../renpy/renpy.sh ../renpy/launcher android_build "$2") ;; *) - COMMAND="../renpy/renpy.sh ../renpy/launcher distribute $2" + COMMAND=(../renpy/renpy.sh ../renpy/launcher distribute "$2") ;; esac - + echo "Building the project for platform '$3' at '$2'..." - if $COMMAND; then - built_dir=$(ls | grep '\-dists') - echo dir=$built_dir >> $GITHUB_OUTPUT - echo version=${built_dir%'-dists'} >> $GITHUB_OUTPUT + if "${COMMAND[@]}"; then + built_dir=$(ls -1 | grep -m1 -- '-dists$') + echo "dir=$built_dir" >> $GITHUB_OUTPUT + echo "version=${built_dir%'-dists'}" >> $GITHUB_OUTPUT else return 1 fi From 83ad654fda2597b88359bf84ad94e33101bcd19c Mon Sep 17 00:00:00 2001 From: MightyElemental <12786983+MightyElemental@users.noreply.github.com> Date: Thu, 5 Feb 2026 15:28:52 +0000 Subject: [PATCH 06/10] [renpy-build] Fixed android build logic - Installs renpy `rapt` library - Points to the correct android SDK folder --- build.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 533976d..4b8e2e2 100755 --- a/build.sh +++ b/build.sh @@ -10,7 +10,7 @@ rm ./${sdk_name}.tar.bz2 mv ./${sdk_name} ../renpy echo "Setup SDK version (${sdk_name})." -# used for steam and web +# used for steam, web, rapt install_lib() { version="$1" lib="$2" @@ -48,6 +48,8 @@ build_platform() { COMMAND=(../renpy/renpy.sh ../renpy/launcher web_build "$2") ;; android) + install_lib "$1" rapt + echo "${ANDROID_SDK_ROOT}" > ../renpy/rapt/sdk.txt COMMAND=(../renpy/renpy.sh ../renpy/launcher android_build "$2") ;; *) From eadedae76de3f6bd709a7ca3d86ea2552914a6e4 Mon Sep 17 00:00:00 2001 From: MightyElemental <12786983+MightyElemental@users.noreply.github.com> Date: Thu, 5 Feb 2026 21:09:25 +0000 Subject: [PATCH 07/10] [renpy-build-action] Added configurable output path - Ren'Py packages apks in a separate location to the desktop and web builds, so this change will bring all files into one location - The project version will be queried and passed to the github output. This is independent of what package is built. --- Dockerfile | 2 +- action.yml | 5 +++++ build.sh | 48 +++++++++++++++++++++++++++++++++++++++--------- 3 files changed, 45 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 40fb6cc..c1f2a32 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:20.04 RUN apt-get update -RUN apt-get install --yes bzip2 wget libxext6 libllvm6.0 mesa-utils unzip rsync +RUN apt-get install --yes bzip2 wget libxext6 libllvm6.0 mesa-utils unzip rsync jq COPY build.sh /build.sh diff --git a/action.yml b/action.yml index a461ff7..ef51544 100644 --- a/action.yml +++ b/action.yml @@ -19,6 +19,10 @@ inputs: required: false default: false type: boolean + output-dir: + description: "The directory where the built files will be placed" + required: false + default: './dist' outputs: dir: description: "The directory where the distributed files exist" @@ -32,6 +36,7 @@ runs: - ${{ inputs.project-dir }} - ${{ inputs.package }} - ${{ inputs.add-steam-lib }} + - ${{ inputs.output-dir }} branding: color: 'gray-dark' icon: 'archive' diff --git a/build.sh b/build.sh index 4b8e2e2..fff362d 100755 --- a/build.sh +++ b/build.sh @@ -10,6 +10,13 @@ rm ./${sdk_name}.tar.bz2 mv ./${sdk_name} ../renpy echo "Setup SDK version (${sdk_name})." +# Get the project version by using renpy's json-dump command +tmp="$(mktemp)" +project_dir="$2" +../renpy/renpy.sh --json-dump "$tmp" "$project_dir" quit >/dev/null +project_version="$(jq -r '.build.version // .config.version // empty' "$tmp")" +rm -f "$tmp" + # used for steam, web, rapt install_lib() { version="$1" @@ -35,9 +42,6 @@ install_lib() { # # Outputs: # Writes `dir` and `version` to $GITHUB_OUTPUT on success -# -# Returns: -# 0 on success; non-zero on failure. build_platform() { case "$3" in pc|win|mac|linux|market) @@ -58,13 +62,37 @@ build_platform() { esac echo "Building the project for platform '$3' at '$2'..." - if "${COMMAND[@]}"; then - built_dir=$(ls -1 | grep -m1 -- '-dists$') - echo "dir=$built_dir" >> $GITHUB_OUTPUT - echo "version=${built_dir%'-dists'}" >> $GITHUB_OUTPUT - else - return 1 + "${COMMAND[@]}" +} + +# Moves compiled distribution files to a single, pre-defined location +# +# Args: +# $1: Output folder +# +# Outputs: +# Writes `dir` and `version` to $GITHUB_OUTPUT +collect_distributions() { + local output_dir="$1" + local built_dir="$(find . -maxdepth 1 -type d -name '*-dists' -print -quit || true)" + + mkdir -p "$output_dir" + + if [[ -n "$built_dir" ]]; then + rsync -a --remove-source-files "$built_dir/" "$output_dir/" + rmdir "$built_dir" 2>/dev/null || true fi + + if [[ -d "../renpy/rapt/bin/" ]]; then + rsync -a -m --remove-source-files \ + --include='*/' \ + --include='*-release.apk' \ + --exclude='*' \ + ../renpy/rapt/bin/ "$output_dir/" + fi + + echo "dir=$output_dir" >> $GITHUB_OUTPUT + echo "version=$project_version" >> $GITHUB_OUTPUT } if [ $4 = "true" ]; then @@ -90,3 +118,5 @@ fi for i in "${target_platforms[@]}"; do build_platform "$1" "$2" "$i" done + +collect_distributions "$5" \ No newline at end of file From e8b00f85278623acb74b6d23c12882fa8d5e9ebe Mon Sep 17 00:00:00 2001 From: MightyElemental <12786983+MightyElemental@users.noreply.github.com> Date: Thu, 5 Feb 2026 21:48:13 +0000 Subject: [PATCH 08/10] [renpy-build] Replaced script argument references with variable names - Also removed redundant parameters from functions and swapped them with the global constants --- build.sh | 73 +++++++++++++++++++++++++++++++------------------------- 1 file changed, 41 insertions(+), 32 deletions(-) diff --git a/build.sh b/build.sh index fff362d..a492801 100755 --- a/build.sh +++ b/build.sh @@ -1,34 +1,42 @@ #!/usr/bin/env bash -sdk_name=renpy-$1-sdk +sdk_version="$1" +project_dir="$2" +targets="$3" +add_steam_lib="$4" +output_dir="$5" + +sdk_name="renpy-$sdk_version-sdk" +renpy_dir="../renpy" +renpy_sh="$renpy_dir/renpy.sh" +renpy_launcher="$renpy_dir/launcher" + echo "Downloading the specified SDK (${sdk_name})..." -wget -q https://www.renpy.org/dl/$1/${sdk_name}.tar.bz2 +wget -q "https://www.renpy.org/dl/$sdk_version/${sdk_name}.tar.bz2" echo "Setting up the specified SDK (${sdk_name})..." tar -xf ./${sdk_name}.tar.bz2 rm ./${sdk_name}.tar.bz2 -mv ./${sdk_name} ../renpy +mv ./${sdk_name} "$renpy_dir" echo "Setup SDK version (${sdk_name})." # Get the project version by using renpy's json-dump command tmp="$(mktemp)" -project_dir="$2" -../renpy/renpy.sh --json-dump "$tmp" "$project_dir" quit >/dev/null +"$renpy_sh" --json-dump "$tmp" "$project_dir" quit >/dev/null project_version="$(jq -r '.build.version // .config.version // empty' "$tmp")" rm -f "$tmp" # used for steam, web, rapt install_lib() { - version="$1" - lib="$2" - name="renpy-$version-$lib" + local lib="$1" + local name="renpy-$sdk_version-$lib" echo "Downloading '${lib}' lib (${name})..." - wget -q "https://www.renpy.org/dl/${version}/${name}.zip" + wget -q "https://www.renpy.org/dl/${sdk_version}/${name}.zip" echo "Adding '${lib}' lib to Renpy..." unzip -qq "./${name}.zip" -d "${name}" - rsync -a "${name}/" ../renpy + rsync -a "${name}/" "$renpy_dir" rm -rf "${name}" "${name}.zip" echo "Added '${lib}' lib (${name})..." } @@ -36,32 +44,33 @@ install_lib() { # Builds a Ren'Py distribution for a target platform # # Args: -# $1: Version -# $2: Project path -# $3: Target platform (pc|win|mac|linux|market|web|android). Default: All. +# $1: Target platform (pc|win|mac|linux|market|web|android). Default: All. # # Outputs: # Writes `dir` and `version` to $GITHUB_OUTPUT on success build_platform() { - case "$3" in + local target="$1" + local COMMAND=("$renpy_sh" "$renpy_launcher") + + case "$target" in pc|win|mac|linux|market) - COMMAND=(../renpy/renpy.sh ../renpy/launcher distribute --package "$3" "$2") + COMMAND+=(distribute --package "$target" "$project_dir") ;; web) - install_lib "$1" web - COMMAND=(../renpy/renpy.sh ../renpy/launcher web_build "$2") + install_lib web + COMMAND+=(web_build "$project_dir") ;; android) - install_lib "$1" rapt - echo "${ANDROID_SDK_ROOT}" > ../renpy/rapt/sdk.txt - COMMAND=(../renpy/renpy.sh ../renpy/launcher android_build "$2") + install_lib rapt + echo "${ANDROID_SDK_ROOT}" > $renpy_dir/rapt/sdk.txt + COMMAND+=(android_build "$project_dir") ;; *) - COMMAND=(../renpy/renpy.sh ../renpy/launcher distribute "$2") + COMMAND+=(distribute "$project_dir") ;; esac - echo "Building the project for platform '$3' at '$2'..." + echo "Building the project for platform '$target' at '$project_dir'..." "${COMMAND[@]}" } @@ -83,26 +92,26 @@ collect_distributions() { rmdir "$built_dir" 2>/dev/null || true fi - if [[ -d "../renpy/rapt/bin/" ]]; then + if [[ -d "$renpy_dir/rapt/bin/" ]]; then rsync -a -m --remove-source-files \ --include='*/' \ --include='*-release.apk' \ --exclude='*' \ - ../renpy/rapt/bin/ "$output_dir/" + "$renpy_dir/rapt/bin/" "$output_dir/" fi echo "dir=$output_dir" >> $GITHUB_OUTPUT echo "version=$project_version" >> $GITHUB_OUTPUT } -if [ $4 = "true" ]; then - install_lib "$1" steam +if [ "$add_steam_lib" = "true" ]; then + install_lib steam fi # Note: This will be checked regardless of the version of Ren'Py. Caution is advised. -if [ -d "$2/old-game" ]; then +if [ -d "$project_dir/old-game" ]; then echo "old-game directory detected." - if [ -z "$(ls -A "$2/old-game")" ]; then + if [ -z "$(ls -A "$project_dir/old-game")" ]; then echo "ERROR: old-game is empty. This will cause incompatibility issues." echo "For more information on how the old-game directory works and why" echo "this directory should not be empty, please refer to the documentation" @@ -111,12 +120,12 @@ if [ -d "$2/old-game" ]; then fi fi -# Split $3 into an array of target platforms -[[ -n ${3-} ]] && read -r -a target_platforms <<<"$3" || target_platforms=("all") +# Split $targets into an array of target platforms +[[ -n ${targets} ]] && read -r -a target_platforms <<<"$targets" || target_platforms=("all") # Build for listed platforms for i in "${target_platforms[@]}"; do - build_platform "$1" "$2" "$i" + build_platform "$i" done -collect_distributions "$5" \ No newline at end of file +collect_distributions "$output_dir" \ No newline at end of file From 27f9ecfecc7f8033ae79e2bd3c74765d19cc53b3 Mon Sep 17 00:00:00 2001 From: MightyElemental <12786983+MightyElemental@users.noreply.github.com> Date: Thu, 5 Feb 2026 22:10:38 +0000 Subject: [PATCH 09/10] [renpy-build-action] Updated README to reflect script changes - Included instructions on how to use the Android build function --- README.md | 48 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e453ab7..396d016 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,11 @@ This GitHub action allows you to make distributable builds of a Ren'Py visual no - name: Build VN project uses: ProjectAliceDev/renpy-build-action@master with: - sdk-version: '6.99.12.4' + sdk-version: '8.5.2' project-dir: '.' + package: 'linux win mac' + add-steam-lib: false + output-dir: './dist' env: SDL_AUDIODRIVER: dummy SDL_VIDEODRIVER: dummy @@ -25,11 +28,48 @@ This GitHub action allows you to make distributable builds of a Ren'Py visual no **Optional Parameters:** -- `package`: Specific package to build for. Must be one of the following: `pc`, `win`, `mac`, `linux`, `market`, `web`, `android` or an array of options such as `['win','mac','linux']` Will build for all packages if value is not supported. +- `package`: Specific package(s) to build for. Supported values: `pc`, `win`, `mac`, `linux`, `market`, `web`, `android`. + You can provide multiple targets as a space-separated string (e.g. `linux win mac`). If omitted, it will build the default distribution. - `add-steam-lib`: Whether to include Steam lib. This is necessary if you want your build to work with Steam achievements. Defaults to `false`. +- `output-dir`: The directory where the built files will be placed. Defaults to `./dist`. + ### Outputs -- `dir`: The directory where the files were built to. -- `version`: The name of the project and version that was built. Often useful in cases where you don't know the version. +- `dir`: The directory where the files were built to (the `output-dir`). +- `version`: The project version detected from Ren'Py (from `build.version` or `config.version`). + +### Android Example + +Building for Android requires Java 21 and Android SDK to be installed. +Environment variables must also be set so that the Android SDK is installed in the workspace. + +```yml +env: + ANDROID_SDK_ROOT: ${{ github.workspace }}/.android-sdk + ANDROID_HOME: ${{ github.workspace }}/.android-sdk +steps: + - name: Setup Java 21 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: "21" + + - name: Setup Android SDK + uses: android-actions/setup-android@v3.2.2 + with: + log-accepted-android-sdk-licenses: false + + - name: Build Android APK + id: build + uses: ProjectAliceDev/renpy-build-action@master + with: + sdk-version: '8.5.2' + package: android + env: + SDL_AUDIODRIVER: dummy + SDL_VIDEODRIVER: dummy +``` + +> :warning: In order to sign the Android APK, you must provide an `android.keystore` file in the project directory. The keystore file should be stored in GitHub Secrets and copied to a file in the project directory before building. See: https://www.renpy.org/doc/html/android.html \ No newline at end of file From ee482438d4c1af2b744cdd75eeb7c42ed3eb2927 Mon Sep 17 00:00:00 2001 From: MightyElemental <12786983+MightyElemental@users.noreply.github.com> Date: Fri, 6 Feb 2026 01:34:33 +0000 Subject: [PATCH 10/10] [renpy-build-action] Added jdk and android sdk to dockerfile. - This is to counter the mismatched and overly complicated setup in workflow files - Updated to Ubuntu 24 LTS --- Dockerfile | 19 +++++++++++++++++-- README.md | 36 ++++++++++-------------------------- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/Dockerfile b/Dockerfile index c1f2a32..226758c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,22 @@ -FROM ubuntu:20.04 +FROM ubuntu:24.04 RUN apt-get update -RUN apt-get install --yes bzip2 wget libxext6 libllvm6.0 mesa-utils unzip rsync jq +RUN apt-get install --yes bzip2 wget libxext6 mesa-utils unzip rsync jq tree openjdk-21-jdk + +# Android SDK location inside container +ENV ANDROID_SDK_ROOT=/opt/android-sdk +ENV ANDROID_HOME=/opt/android-sdk +ENV PATH="${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin:${ANDROID_SDK_ROOT}/platform-tools:${PATH}" + +# Install Android cmdline tools (sdkmanager) then required SDK packages +RUN mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools \ + && cd /tmp \ + && wget -q -O cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip \ + && unzip -q cmdline-tools.zip \ + && mv cmdline-tools ${ANDROID_SDK_ROOT}/cmdline-tools/latest \ + && rm -f cmdline-tools.zip \ + && yes | sdkmanager --licenses >/dev/null \ + && sdkmanager --install "platform-tools" COPY build.sh /build.sh diff --git a/README.md b/README.md index 396d016..b55acc2 100644 --- a/README.md +++ b/README.md @@ -42,34 +42,18 @@ This GitHub action allows you to make distributable builds of a Ren'Py visual no ### Android Example -Building for Android requires Java 21 and Android SDK to be installed. -Environment variables must also be set so that the Android SDK is installed in the workspace. +This action automatically installs the Android SDK and all required packages for building Android apps, so you don't need to set up java JDK or Android SDK manually. ```yml -env: - ANDROID_SDK_ROOT: ${{ github.workspace }}/.android-sdk - ANDROID_HOME: ${{ github.workspace }}/.android-sdk -steps: - - name: Setup Java 21 - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: "21" - - - name: Setup Android SDK - uses: android-actions/setup-android@v3.2.2 - with: - log-accepted-android-sdk-licenses: false - - - name: Build Android APK - id: build - uses: ProjectAliceDev/renpy-build-action@master - with: - sdk-version: '8.5.2' - package: android - env: - SDL_AUDIODRIVER: dummy - SDL_VIDEODRIVER: dummy +- name: Build Android APK + id: build + uses: ProjectAliceDev/renpy-build-action@master + with: + sdk-version: '8.5.2' + package: android + env: + SDL_AUDIODRIVER: dummy + SDL_VIDEODRIVER: dummy ``` > :warning: In order to sign the Android APK, you must provide an `android.keystore` file in the project directory. The keystore file should be stored in GitHub Secrets and copied to a file in the project directory before building. See: https://www.renpy.org/doc/html/android.html \ No newline at end of file