-
-
Save jotson/18730220b2e72ada27a60a8edffdc673 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import subprocess | |
import discord | |
import version | |
BUILDDIR = '/home/john/code/games/gravity/build' | |
STEAM_COMMAND = '/home/john/code/games/gravity/build/sdk/tools/ContentBuilder/builder_linux/steamcmd.sh' | |
STEAM_APP_CONFIG = '/home/john/code/games/gravity/build/sdk/tools/ContentBuilder/scripts/app_build_1003860.vdf' | |
print('Pushing a new public build! Exciting!\n') | |
print('Here is the current changelog:\n\n%s\n' % discord.get_changelog()) | |
answer = input('Does the changelog look okay? (y/n/yes/no, default=no) ') | |
if answer == 'y' or answer == 'yes': | |
print('OK!\n') | |
else: | |
print('\nGet writing!') | |
exit() | |
# Tag git with version | |
print('This is version %s\n' % version.get_public_version()) | |
answer = input('Is that correct? (y/n/yes/no, default=no) ') | |
if answer == 'y' or answer == 'yes': | |
print('OK!\n') | |
else: | |
print('\nAborted') | |
exit() | |
# Push to itch.io | |
ITCH_PROJECT = 'jotson/gravity' | |
BUTLER = '/home/john/.config/itch/apps/butler/butler' | |
builds = { | |
"linux-playtest-64": "linux64", | |
"windows-playtest-64": "win64", | |
"osx-playtest": "osx/gravity-osx.app.zip" | |
} | |
for destination, folder in builds.items(): | |
print("[itch] Pushing %s..." % destination) | |
command = [BUTLER, 'push', '--fix-permissions', "%s/%s" % (BUILDDIR, folder), "%s:%s" % (ITCH_PROJECT, destination)] | |
command.extend(['--userversion', str(version.get_version())]) | |
subprocess.check_output(command) | |
# Push to Steam | |
username = None | |
password = None | |
with open(BUILDDIR + "/.steam", "r") as f: | |
username = f.readline().rstrip() | |
password = f.readline().rstrip() | |
print("[steam] Pushing builds...") | |
command = [STEAM_COMMAND, '+login', username, password, "+run_app_build", STEAM_APP_CONFIG, "+quit"] | |
output = subprocess.check_output(command) | |
print(output.decode('utf-8')) | |
# Post changelog to discord | |
discord.post_changelog() | |
print('\nAll done!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment