Skip to content

Commit

Permalink
Add target to automate tagging of releases
Browse files Browse the repository at this point in the history
When debugging, it's very useful to know which version a player is
using. The version is now displayed in the title bar.
  • Loading branch information
kyleconroy committed May 26, 2012
1 parent 6e0ef53 commit 98a9110
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 6 deletions.
16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
.PHONY: love osx clean

current_version = $(shell python scripts/version.py current)
next_version = $(shell python scripts/version.py bump)

love:
mkdir -p build
cd src && zip -r ../build/hawkthorne.love . -x ".*" \
-x ".DS_Store" -x "*/full_soundtrack.ogg"

download:
curl -L https://bitbucket.org/rude/love/downloads/love-0.8.0-win-x86.exe > build/love-win-x86.exe
curl -L https://bitbucket.org/rude/love/downloads/love-0.8.0-win-x64.exe > build/love-win-x64.exe


osx: love
cp -r /Applications/love.app Journey\ to\ the\ Center\ of\ Hawkthorne.app
cp build/hawkthorne.love Journey\ to\ the\ Center\ of\ Hawkthorne.app/Contents/Resources
Expand Down Expand Up @@ -43,5 +41,13 @@ upload: osx win
python scripts/upload.py build/hawkthorne-win-x86.zip
python scripts/upload.py build/hawkthorne-win-x64.zip

tag:
sed -i '' 's/$(current_version)/$(next_version)/g' src/conf.lua
git add src/conf.lua
git commit -m "Bump release version to $(next_version)"
git tag -a $(next_version) -m "Tagged new release at version $(next_version)"
# git push --tags


clean:
rm -rf build
36 changes: 36 additions & 0 deletions scripts/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""
Bump the version number
"""
import os
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('action', choices=['bump', 'current'])
args = parser.parse_args()

version = None
title = None

for line in open('src/conf.lua'):
line = line.strip()
if 't.title' not in line:
continue
_, full_title = line.replace('"', '').split('=')
title, current = full_title.strip().rsplit(' ', 1)
x, y, z = current.split('.')

z = int(z) + (1 if args.action == 'bump' else 0)

version = "{}.{}.{}".format(x,y,z)

if not title or not version:
print "Could not find version number"
exit(1)

if version == '0.8.0':
print "This is the LOVE version, not safe"
exit(1)

print version
exit(0)

5 changes: 4 additions & 1 deletion src/conf.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
function love.conf(t)
t.title = "Journey to the Center of Hawkthorne"
t.title = "Journey to the Center of Hawkthorne v0.0.1"
t.author = "Kyle Conroy"
t.version = "0.8.0"
t.identity = "hawkthorne"
t.screen.width = 768
t.screen.height = 528
t.console = false
t.modules.physics = false
t.modules.joystick = false
t.release = false
end

0 comments on commit 98a9110

Please sign in to comment.