From b8f2a14ea09799ea8584553c973ee47dc673ea12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Tue, 2 Jun 2020 19:24:20 +0200 Subject: [PATCH] Automatically upload release to itch.io using butler. --- .travis.yml | 1 + packaging/itch/upload.sh | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100755 packaging/itch/upload.sh diff --git a/.travis.yml b/.travis.yml index 107a7ce2a6..6eaf32576a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -75,6 +75,7 @@ before_deploy: - cd packaging - mkdir build - ./package-all.sh ${TRAVIS_TAG} ${PWD}/build/ + - cd itch && ./upload.sh ${TRAVIS_TAG} ${PWD}/build/ deploy: provider: releases api_key: diff --git a/packaging/itch/upload.sh b/packaging/itch/upload.sh new file mode 100755 index 0000000000..2ef179784f --- /dev/null +++ b/packaging/itch/upload.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +export GIT_TAG="$1" +export BUILD_OUTPUT_DIR="$2" + +case "${GIT_TAG}" in + bleed) + exit + ;; + next | playtest-*) + exit + ;; + master | release-*) + ;; + *) + echo "Unknown branch: $1" + exit + ;; +esac + +if command -v curl >/dev/null 2>&1; then + curl -L -o butler-linux-amd64.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default +else + wget -cq -O butler-linux-amd64.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default +fi + +unzip butler-linux-amd64.zip +chmod +x butler +./butler -V +./butler login + +./butler push "${BUILD_OUTPUT_DIR}/OpenRA-${GIT_TAG}-x64.exe" "openra/openra:win" --userversion-file ../../VERSION +./butler push --fix-permissions "${BUILD_OUTPUT_DIR}/OpenRA-${GIT_TAG}.dmg" "openra/openra:osx" --userversion-file ../../VERSION +./butler push --fix-permissions "${BUILD_OUTPUT_DIR}/OpenRA-Dune-2000-x86_64.AppImage" "openra/openra:linux-d2k" --userversion-file ../../VERSION +./butler push --fix-permissions "${BUILD_OUTPUT_DIR}/OpenRA-Red-Alert-x86_64.AppImage" "openra/openra:linux-ra" --userversion-file ../../VERSION +./butler push --fix-permissions "${BUILD_OUTPUT_DIR}/OpenRA-Tiberian-Dawn-x86_64.AppImage" "openra/openra:linux-td" --userversion-file ../../VERSION