├── Dockerfile ├── LICENSE ├── README.md ├── action.yml └── build.sh /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | 3 | RUN apt-get update 4 | RUN apt-get install --yes bzip2 wget libxext6 libllvm6.0 mesa-utils unzip rsync 5 | 6 | COPY build.sh /build.sh 7 | 8 | ENTRYPOINT ["/build.sh"] 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2019, Project Alice 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Build Ren'Py Project 2 | 3 | This GitHub action allows you to make distributable builds of a Ren'Py visual novel project in a workflow and use the built files for distribution. 4 | 5 | ## Usage 6 | 7 | ```yml 8 | - name: Build VN project 9 | uses: ProjectAliceDev/renpy-build-action@master 10 | with: 11 | sdk-version: '6.99.12.4' 12 | project-dir: '.' 13 | env: 14 | SDL_AUDIODRIVER: dummy 15 | SDL_VIDEODRIVER: dummy 16 | ``` 17 | 18 | **Required Parameters:** 19 | 20 | - `sdk-version`: The version of the Ren'Py SDK to use while building. Will default to `7.3.2` if none is found. 21 | 22 | - `project-dir`: The directory where the project exists. Will default to `'.'` (root) if none is found. 23 | 24 | > :warning: If you are targeting Ren'Py v7.4.0+, you must use v1.1.2 of this action or greater. 25 | 26 | **Optional Parameters:** 27 | 28 | - `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. 29 | 30 | - `add-steam-lib`: Whether to include Steam lib. This is necessary if you want your build to work with Steam achievements. Defaults to `false`. 31 | 32 | ### Outputs 33 | 34 | - `dir`: The directory where the files were built to. 35 | - `version`: The name of the project and version that was built. Often useful in cases where you don't know the version. 36 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: "Build Ren'Py Project" 2 | author: 'Project Alice' 3 | description: "Build your VN project using a specified Ren'Py SDK version" 4 | inputs: 5 | sdk-version: 6 | description: "The version of the Ren'Py SDK to use" 7 | required: true 8 | default: '7.3.2' 9 | project-dir: 10 | description: "The path to the directory where the project exists" 11 | required: true 12 | default: '.' 13 | package: 14 | description: "Specific package to build for" 15 | required: false 16 | type: string 17 | add-steam-lib: 18 | description: "Whether to include Steam lib" 19 | required: false 20 | default: false 21 | type: boolean 22 | outputs: 23 | dir: 24 | description: "The directory where the distributed files exist" 25 | version: 26 | description: "The built version of the project" 27 | runs: 28 | using: 'docker' 29 | image: 'Dockerfile' 30 | args: 31 | - ${{ inputs.sdk-version }} 32 | - ${{ inputs.project-dir }} 33 | - ${{ inputs.package }} 34 | - ${{ inputs.add-steam-lib }} 35 | branding: 36 | color: 'gray-dark' 37 | icon: 'archive' 38 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | sdk_name=renpy-$1-sdk 4 | echo "Downloading the specified SDK (${sdk_name})..." 5 | wget -q https://www.renpy.org/dl/$1/${sdk_name}.tar.bz2 6 | clear 7 | 8 | echo "Downloaded SDK version (${sdk_name})." 9 | echo "Setting up the specified SDK (${sdk_name})..." 10 | tar -xf ./${sdk_name}.tar.bz2 11 | rm ./${sdk_name}.tar.bz2 12 | mv ./${sdk_name} ../renpy 13 | 14 | if [ $4 = "true" ]; then 15 | steam_lib_name=renpy-$1-steam 16 | echo "Downloading Steam lib (${steam_lib_name})..." 17 | wget -q https://www.renpy.org/dl/$1/${steam_lib_name}.zip 18 | clear 19 | 20 | echo "Downloaded Steam lib (${steam_lib_name})..." 21 | echo "Adding Steam lib to Renpy" 22 | unzip -qq ./${steam_lib_name} -d ${steam_lib_name} 23 | rsync -a ${steam_lib_name}/ ../renpy 24 | rm -rf ${steam_lib_name} ${steam_lib_name}.zip 25 | fi 26 | 27 | # Note: This will be checked regardless of the version of Ren'Py. Caution is 28 | # advised. 29 | if [ -d "$2/old-game" ]; then 30 | echo "old-game directory detected." 31 | if [ -z "$(ls -A "$2/old-game")" ]; then 32 | echo "ERROR: old-game is empty. This will cause incompatibility issues." 33 | echo "For more information on how the old-game directory works and why" 34 | echo "this directory should not be empty, please refer to the documentation" 35 | echo "at: https://www.renpy.org/doc/html/build.html#old-game." 36 | exit 1 37 | fi 38 | fi 39 | 40 | if [[ "$(declare -p -- "$3")" == "declare -a "* ]]; then 41 | for i in "${3[@]}" 42 | do 43 | if [ $i == 'android' ]; then 44 | COMMAND="../renpy/renpy.sh ../renpy/launcher android_build $2" 45 | elif [ $i == 'web' ]; then 46 | COMMAND="../renpy/renpy.sh ../renpy/launcher web_build $2" 47 | else 48 | COMMAND="../renpy/renpy.sh ../renpy/launcher distribute --package $i $2" 49 | fi 50 | echo "Building $i" 51 | if $COMMAND; then 52 | built_dir=$(ls | grep '\-dists') 53 | echo dir=$built_dir >> $GITHUB_OUTPUT 54 | echo version=${built_dir%'-dists'} >> $GITHUB_OUTPUT 55 | else 56 | return 1 57 | fi 58 | done 59 | else 60 | case $3 in 61 | pc|win|mac|linux|market) 62 | COMMAND="../renpy/renpy.sh ../renpy/launcher distribute --package $3 $2" 63 | ;; 64 | web) 65 | COMMAND="../renpy/renpy.sh ../renpy/launcher web_build $2" 66 | ;; 67 | android) 68 | COMMAND="../renpy/renpy.sh ../renpy/launcher android_build $2" 69 | ;; 70 | *) 71 | COMMAND="../renpy/renpy.sh ../renpy/launcher distribute $2" 72 | ;; 73 | esac 74 | 75 | echo "Building the project at $2..." 76 | if $COMMAND; then 77 | built_dir=$(ls | grep '\-dists') 78 | echo dir=$built_dir >> $GITHUB_OUTPUT 79 | echo version=${built_dir%'-dists'} >> $GITHUB_OUTPUT 80 | else 81 | return 1 82 | fi 83 | fi 84 | 85 | --------------------------------------------------------------------------------