From 79d216d21a4787040ea6d92a28634ee7596715c7 Mon Sep 17 00:00:00 2001 From: Joseph Manley Date: Sat, 30 Nov 2019 21:58:18 -0500 Subject: [PATCH] Intial dockerized version of butler Fix exec cat -> echo Push package then --- Dockerfile | 17 +++++++++++++++++ action.yml | 9 +++++++++ entrypoint.sh | 18 ++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 Dockerfile create mode 100644 action.yml create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d8868fb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM centos:8 + +LABEL "com.github.actions.name"="Butler Push" +LABEL "com.github.actions.description"="Publishes releases to Itch.io using Butler" +LABEL "com.github.actions.icon"="upload" +LABEL "com.github.actions.color"="white" + +RUN yum update -y + +# Install Butler +ADD https://dl.itch.ovh/butler/linux-amd64/head/butler /usr/bin/ +RUN chmod +x /usr/bin/butler + +# Run butler push +ADD entrypoint.sh /entrypoint.sh +RUN chmod +x entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..e07ab99 --- /dev/null +++ b/action.yml @@ -0,0 +1,9 @@ +name: "Butler Push" +description: "Publish releases to Itch.io using Butler" +author: josephbmanley +runs: + using: docker + image: Dockerfile +branding: + icon: upload + color: white \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..438a77d --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/sh +set -e + +mkdir -p ~/.config/itch +echo $BUTLER_CREDENTIALS > ~/.config/itch/butler_creds + + +versionArguement="" + +if [ "$VERSION" != "" ] +then + versionArguement="--userversion ${VERSION}" +elif [ "$VERSION_FILE" != "" ] +then + versionArguement="--userversion-file ${VERSION_FILE}" +fi + +butler push $PACKAGE $ITCH_USER/$ITCH_GAME:$CHANNEL ${versionArguement} \ No newline at end of file