Added many, many more actions.
This commit is contained in:
73
renpy/renpy-distribute/action.yaml
Normal file
73
renpy/renpy-distribute/action.yaml
Normal file
@@ -0,0 +1,73 @@
|
||||
name: renpy-distribute
|
||||
description: "Build a RenPy project for various platforms."
|
||||
inputs:
|
||||
project:
|
||||
description: "Path to the RenPy project."
|
||||
required: true
|
||||
package:
|
||||
description: "The specific package to build. Values: win, mac, linux, android, pc, market" #TODO: android
|
||||
required: true
|
||||
dest:
|
||||
description: "Destination folder for the builds."
|
||||
required: false
|
||||
packageDest:
|
||||
description: "Destination folder for the indivdual package."
|
||||
required: false
|
||||
archive:
|
||||
description: "Whether or not to compress the build into a zip file."
|
||||
required: true
|
||||
default: "true"
|
||||
format:
|
||||
description: "The archive format to use. Values: zip, tar.bz2 Default: zip"
|
||||
required: true
|
||||
default: "zip"
|
||||
additionalArgs:
|
||||
description: "Additional arguments to pass into RenPy."
|
||||
required: false
|
||||
outputs:
|
||||
package:
|
||||
description: "The path to the package or packages."
|
||||
value: ${{ steps.command.outputs.output }}
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: "Build command."
|
||||
id: command
|
||||
run: |
|
||||
# Replace each space with a backslash and a space
|
||||
PROJECT="${{ inputs.project }}"
|
||||
PROJECT="${PROJECT// /\\ }"
|
||||
COMMAND="distribute $PROJECT --package ${{ inputs.package }} ${{ inputs.additionalArgs }}"
|
||||
|
||||
ARCHIVE="${{ inputs.archive }}"
|
||||
if [[ "$ARCHIVE" == "false" ]]; then
|
||||
COMMAND="$COMMAND --no-archive"
|
||||
EXT=""
|
||||
else
|
||||
EXT=".${{ inputs.format }}"
|
||||
fi
|
||||
|
||||
DEST="${{ inputs.dest }}"
|
||||
if [[ -n "$DEST" ]]; then
|
||||
OUTPUT="$DEST"
|
||||
mkdir -p "$DEST"
|
||||
COMMAND="$COMMAND --destination $DEST"
|
||||
fi
|
||||
FORMAT="${{ inputs.format }}"
|
||||
if [[ -n "$FORMAT" ]]; then
|
||||
COMMAND="$COMMAND --format $FORMAT"
|
||||
fi
|
||||
PACKAGE_DEST="${{ inputs.packageDest }}"
|
||||
if [[ -n "$PACKAGE_DEST" ]]; then
|
||||
OUTPUT="${PACKAGE_DEST}${EXT}"
|
||||
mkdir -p "$PACKAGE_DEST"
|
||||
COMMAND="$COMMAND --packagedest $PACKAGE_DEST"
|
||||
fi
|
||||
echo "command=$COMMAND" >> "$GITHUB_OUTPUT"
|
||||
echo "output=$OUTPUT" >> "$GITHUB_OUTPUT"
|
||||
shell: bash
|
||||
- name: "Run RenPy distribute command."
|
||||
uses: act/common/renpy/renpy@master
|
||||
with:
|
||||
command: ${{ steps.command.outputs.command }}
|
||||
catchErrors: true
|
||||
8
renpy/renpy/Dockerfile
Normal file
8
renpy/renpy/Dockerfile
Normal file
@@ -0,0 +1,8 @@
|
||||
# Container image that runs your code
|
||||
FROM maienm/renpy:8.1.0
|
||||
ENV RENPY_HOME="/opt/renpy/"
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
21
renpy/renpy/action.yaml
Normal file
21
renpy/renpy/action.yaml
Normal file
@@ -0,0 +1,21 @@
|
||||
name: renpy
|
||||
description: "Run RenPy commands."
|
||||
inputs:
|
||||
command:
|
||||
description: "Arguments to pass into RenPy."
|
||||
required: true
|
||||
catchErrors:
|
||||
description: "Whether or not errors should be handled."
|
||||
required: false
|
||||
outputs:
|
||||
console:
|
||||
description: "The console output of the RenPy command."
|
||||
exitCode:
|
||||
description: "How the program exited."
|
||||
runs:
|
||||
using: docker
|
||||
image: Dockerfile
|
||||
env:
|
||||
CATCH_ERRORS: ${{ inputs.catchErrors }}
|
||||
args:
|
||||
- ${{ inputs.command }}
|
||||
27
renpy/renpy/entrypoint.sh
Normal file
27
renpy/renpy/entrypoint.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
ARGS="$@"
|
||||
|
||||
set -o pipefail
|
||||
exec 5>&1
|
||||
OUTPUT=$(bash -c "$RENPY_HOME/renpy.sh $RENPY_HOME/launcher $ARGS" | tee /dev/fd/5)
|
||||
RESULT=$?
|
||||
|
||||
#Output multiline strings.
|
||||
#https://trstringer.com/github-actions-multiline-strings/
|
||||
# if [[ -n "$OUTPUT" ]]; then
|
||||
# echo "console<<EOF" >> "$GITHUB_OUTPUT"
|
||||
# echo "$OUTPUT" >> "$GITHUB_OUTPUT"
|
||||
# echo "EOF" >> "$GITHUB_OUTPUT"
|
||||
# fi
|
||||
if [[ -n "$OUTPUT" ]]; then
|
||||
OUTPUT="${OUTPUT//'%'/'%25'}"
|
||||
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
|
||||
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
|
||||
echo "::set-output name=console::$OUTPUT"
|
||||
fi
|
||||
|
||||
echo "exitCode=$RESULT" >> "$GITHUB_OUTPUT"
|
||||
|
||||
if [[ "$CATCH_ERRORS" != "true" ]]; then
|
||||
exit $RESULT
|
||||
fi
|
||||
Reference in New Issue
Block a user