From 6df44cac728e46248bcffcb519f84bcf2b0fe2a5 Mon Sep 17 00:00:00 2001 From: Julien Deswaef Date: Mon, 13 Jan 2020 20:07:57 +0100 Subject: [PATCH] Adds Itch.io Butler --- .gitlab-ci.yml | 24 ++++++++++++++++++++++++ Dockerfile | 6 ++++++ README.md | 1 + getbutler.sh | 13 +++++++++++++ 4 files changed, 44 insertions(+) create mode 100644 getbutler.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 73b7eac..9f47970 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,8 @@ stages: variables: EXPORT_NAME: game-off + ITCHIO_USERNAME: user + ITCHIO_GAME: game before_script: - mkdir -v -p build/linux @@ -77,3 +79,25 @@ pages: artifacts: paths: - public + +# Itch.io Deploy +itchio:linux: + stage: deploy + script: + - butler push $EXPORT_NAME $ITCHIO_USERNAME/$ITCHIO_GAME:linux64 + dependencies: + - linux + +itchio:windows: + stage: deploy + script: + - butler push $EXPORT_NAME.exe $ITCHIO_USERNAME/$ITCHIO_GAME:windows + dependencies: + - windows + +itchio:macosx: + stage: deploy + script: + - butler push $EXPORT_NAME.zip $ITCHIO_USERNAME/$ITCHIO_GAME:mac64 + dependencies: + - mac diff --git a/Dockerfile b/Dockerfile index 16d3a6d..407e5ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,3 +23,9 @@ RUN wget https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}/Godot_v${G && unzip Godot_v${GODOT_VERSION}-stable_export_templates.tpz \ && mv templates/* ~/.local/share/godot/templates/${GODOT_VERSION}.stable \ && rm -f Godot_v${GODOT_VERSION}-stable_export_templates.tpz Godot_v${GODOT_VERSION}-stable_linux_headless.64.zip + +ADD getbutler.sh /opt/butler/getbutler.sh +RUN bash /opt/butler/getbutler.sh +RUN /opt/butler/bin/butler -V + +ENV PATH="/opt/butler/bin:${PATH}" diff --git a/README.md b/README.md index 2d39c86..abe780a 100644 --- a/README.md +++ b/README.md @@ -31,5 +31,6 @@ Delete the `pages` job and set the following **Variables** in the GitLab CI/CD p | $REMOTE_URL | The `git remote` where the web export will be hosted (in this case GitHub), it should contain your [deploy/personal access token](https://github.com/settings/tokens)|`https://:@github.com//.git` | $GIT_EMAIL | Git email of the account that will commit to the `gh-pages` branch. | `artur@barichello.me` | $GIT_USERNAME | Username of the account that will commit to the `gh-pages` branch. | `abarichello` +| $BUTLER_API_KEY | [Itch.io authentification key](https://itch.io/user/settings/api-keys). | `gH89Cd15UHqWBpyU8Ri42Q` Others variables are set automatically by the `gitlab-runner`, see the documentation for [predefined variables](https://docs.gitlab.com/ee/ci/variables/predefined_variables.html).
diff --git a/getbutler.sh b/getbutler.sh new file mode 100644 index 0000000..c28f440 --- /dev/null +++ b/getbutler.sh @@ -0,0 +1,13 @@ +#!/usr/bin/bash + +mkdir -p /opt/butler/bin +cd /opt/butler/bin + +wget -O butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default +unzip butler.zip + +# GNU unzip tends to not set the executable bit even though it's set in the .zip +chmod +x butler + +export PATH=/opt/butler/bin/:$PATH +cd ~