Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release for version 0.0.77 #1304

Merged
merged 7 commits into from Apr 25, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions .travis.yml
@@ -1,9 +1,11 @@
language: erlang
language: objective-c
install:
- sudo apt-get install luarocks
- sudo apt-get install python-virtualenv
- sudo luarocks install luafilesystem
- sudo luarocks install busted
- brew update
- brew install lua luarocks
- sudo easy_install pip
- sudo pip install virtualenv
- luarocks install luafilesystem
- luarocks install busted
env:
global:
- secure: "MA1+zHILO7O99n5+nj6jxuqVHUM0ZcGFfiZ9GT/4JyOG8nGkKWXopW/PbDzj\nRRFW3oknkm9jwVgCccvb2oSCPhEUVEUwcdo6xMuCFnskQNAA4q/SWAXXcZvm\nLjaJHNIb66Nnti+dhfAtfNvw8InzV7RzlmBxRrlH9M/0+X2gE5U="
Expand Down
112 changes: 37 additions & 75 deletions Makefile
@@ -1,4 +1,4 @@
.PHONY: love osx clean contributors win32 win64 maps tweet post run release forum
.PHONY: clean contributors run forum productionize deploy love

UNAME := $(shell uname)

Expand All @@ -16,30 +16,18 @@ else
wget = wget --no-check-certificate
endif

mixpanel_dev = ac1c2db50f1332444fd0cafffd7a5543

ifndef MIXPANEL_TOKEN
mixpanel_prod = $(mixpanel_dev)
else
mixpanel_prod = $(MIXPANEL_TOKEN)
endif

maps := $(patsubst %.tmx,%.lua,$(wildcard src/maps/*.tmx))

love: build/hawkthorne.love

love: maps build
@sed -i.bak 's/$(mixpanel_dev)/$(mixpanel_prod)/g' src/main.lua
cd src && zip -q -r ../build/hawkthorne.love . -x ".*" \
-x ".DS_Store" -x "*/full_soundtrack.ogg" -x "main.lua.bak"
mv src/main.lua.bak src/main.lua

build:
build/hawkthorne.love: $(maps) src
mkdir -p build
cd src && zip -q -r ../build/hawkthorne.love . -x ".*" \
-x ".DS_Store" -x "*/full_soundtrack.ogg" -x "*.bak"

run: maps $(LOVE)
run: $(maps) $(LOVE)
$(LOVE) src

maps: $(patsubst %.tmx,%.lua,$(wildcard src/maps/*.tmx))

src/maps/%.lua: src/maps/%.tmx bin/tmx2lua
bin/tmx2lua $<

Expand Down Expand Up @@ -68,19 +56,12 @@ bin/love.app/Contents/MacOS/love:
# THE REST OF THESE TARGETS ARE FOR RELEASE AUTOMATION
######################################################

current_version = $(shell python scripts/version.py current)
sparkle_version = $(shell python scripts/version.py current --sparkle)
next_version = $(shell python scripts/version.py next)
previous_version = $(shell python scripts/version.py previous)

CI_TARGET=test

ifeq ($(TRAVIS), true)
ifeq ($(TRAVIS_BRANCH), master)
ifeq ($(TRAVIS_BRANCH), release)
ifeq ($(TRAVIS_PULL_REQUEST), false)
ifeq ($(shell python scripts/bump.py), true)
CI_TARGET=clean test upload social
endif
CI_TARGET=clean test productionize upload deltas social
endif
endif
endif
Expand All @@ -90,9 +71,8 @@ positions: $(patsubst %.png,%.lua,$(wildcard src/positions/*.png))
src/positions/%.lua: psds/positions/%.png
overlay2lua src/positions/config.json $<

win: win32/love.exe win32 win64

win32: love
build/hawkthorne-win-x86.zip: build/hawkthorne.love
mkdir -p build
rm -rf hawkthorne
rm -f hawkthorne-win-x86.zip
cat win32/love.exe build/hawkthorne.love > win32/hawkthorne.exe
Expand All @@ -105,79 +85,60 @@ win32/love.exe:
unzip -q windows-build-files.zip
rm -f windows-build-files.zip

win64: love
build/hawkthorne-win-x64.zip: build/hawkthorne.love
mkdir -p build
rm -rf hawkthorne
rm -f hawkthorne-win-x64.zip
cat win64/love.exe build/hawkthorne.love > win64/hawkthorne.exe
cp -r win64 hawkthorne
zip -q -r hawkthorne-win-x64 hawkthorne -x "*/love.exe"
mv hawkthorne-win-x64.zip build

osx: maps bin/love.app/Contents/MacOS/love build
build/hawkthorne-osx.zip: bin/love.app/Contents/MacOS/love $(maps)
mkdir -p build
cp -r bin/love.app Journey\ to\ the\ Center\ of\ Hawkthorne.app
sed -i.bak 's/0.0.1/$(sparkle_version)/g' \
Journey\ to\ the\ Center\ of\ Hawkthorne.app/Contents/Info.plist
@sed -i.bak 's/$(mixpanel_dev)/$(mixpanel_prod)/g' src/main.lua
cp -r src Journey\ to\ the\ Center\ of\ Hawkthorne.app/Contents/Resources/hawkthorne.love
rm -f Journey\ to\ the\ Center\ of\ Hawkthorne.app/Contents/Resources/hawkthorne.love/.DS_Store
find Journey\ to\ the\ Center\ of\ Hawkthorne.app/Contents -name "*.bak" -delete
mv src/main.lua.bak src/main.lua
cp osx/Info.plist \
Journey\ to\ the\ Center\ of\ Hawkthorne.app/Contents/Info.plist
cp osx/Hawkthorne.icns \
Journey\ to\ the\ Center\ of\ Hawkthorne.app/Contents/Resources/Love.icns
zip -q -r hawkthorne-osx Journey\ to\ the\ Center\ of\ Hawkthorne.app
mv hawkthorne-osx.zip build
rm -rf Journey\ to\ the\ Center\ of\ Hawkthorne.app

upload: osx win venv
venv/bin/python scripts/upload.py releases/$(current_version) build/hawkthorne.love
venv/bin/python scripts/upload.py releases/$(current_version) build/hawkthorne-osx.zip
venv/bin/python scripts/upload.py releases/$(current_version) build/hawkthorne-win-x86.zip
venv/bin/python scripts/upload.py releases/$(current_version) build/hawkthorne-win-x64.zip
venv/bin/python scripts/symlink.py $(current_version)
productionize:
venv/bin/python scripts/productionize.py

binaries: build/hawkthorne-osx.zip build/hawkthorne-win-x64.zip build/hawkthorne-win-x86.zip

upload: binaries venv
venv/bin/python scripts/upload_binaries.py

deltas:
deltas: venv
venv/bin/python scripts/sparkle.py
cat sparkle/appcast.xml | xmllint -format - # Make sure the appcast is valid xml
venv/bin/python scripts/upload.py / sparkle/appcast.xml

release: release.md
git fetch origin
git fetch --tags
sed -i '' 's/$(current_version)/$(next_version)/g' src/conf.lua
git add src/conf.lua
git commit -eF release.md
git push origin master
git tag -a $(next_version) -m "Tagged new release at version $(next_version)"
git push --tags

release.md: venv
git fetch --tags
venv/bin/python scripts/release_markdown.py $(current_version) master $@

forum: venv
@venv/bin/python scripts/create_forum_post.py $(current_version)


social: venv notes post
venv/bin/python scripts/create_release_post.py $(current_version) post.md

notes: notes.html post
social: venv post.md notes.html
venv/bin/python scripts/upload.py releases/$(current_version) notes.html

notes.html: post
venv/bin/python scripts/socialize.py post.md

notes.html: post.md
venv/bin/python -m markdown post.md > notes.html

post:
git show -s --format=%s $(current_version)^{commit} > $@.md
echo "\n" >> $@.md
git show -s --format=%b $(current_version)^{commit} >> $@.md
post.md:
venv/bin/python scripts/create_post.py $(shell git log master -n 1 --pretty=format:%H) post.md

venv:
virtualenv --python=python2.7 venv
venv/bin/pip install -r requirements.txt
virtualenv -q --python=python2.7 venv
venv/bin/pip install -q -r requirements.txt

deploy: $(CI_TARGET)

forum: venv
venv/bin/python scripts/create_forum_post.py

contributors: venv
venv/bin/python scripts/clean.py > CONTRIBUTORS
venv/bin/python scripts/credits.py > src/credits.lua
Expand All @@ -190,6 +151,7 @@ clean:
rm -f release.md
rm -f post.md
rm -f notes.html
rm -rf src/maps/*.lua
rm -rf Journey\ to\ the\ Center\ of\ Hawkthorne.app

reset:
Expand Down
7 changes: 7 additions & 0 deletions README.md
Expand Up @@ -66,6 +66,13 @@ Congratulations! You're running Journey to the Center of Hawkthorne! Your next s
- [/r/hawkthorne subreddit](http://www.reddit.com/r/hawkthorne)
- [#hawkthorne@irc.freenode.net](http://webchat.freenode.net/?channels=hawkthorne) on IRC


## Releasing a new version

We release a new version of Journey to the Center of Hawkthorne about every two
weeks. To create a release, open a pull request from the `master` branch to the
`release` branch. You should never commit directly to the `release` branch.

## License

Unless otherwise noted, this code is licensed under the MIT License.
Expand Down
6 changes: 3 additions & 3 deletions osx/Info.plist
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>HaWk</string>
<key>CFBundleVersion</key>
<string>0.0.1</string>
<string>0.0.77</string>
<key>DTCompiler</key>
<string></string>
<key>DTPlatformBuild</key>
Expand All @@ -37,12 +37,12 @@
<key>DTXcodeBuild</key>
<string>4G1004</string>
<key>NSHumanReadableCopyright</key>
<string>© 2006-2012 LÖVE Development Team</string>
<string>2006-2012 Hawkthorne Development Team</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>SUFeedURL</key>
<string>http://files.projecthawkthorne.com/appcast.xml</string>
<key>SUPublicDSAKeyFile</key>
<string>dsa_pub.pem</string>
</dict>
</plist>
</plist>
17 changes: 0 additions & 17 deletions scripts/bump.py

This file was deleted.

57 changes: 57 additions & 0 deletions scripts/create_post.py
@@ -0,0 +1,57 @@
import os
import sys
from datetime import datetime
import argparse
import boto
import requests
import jinja2
import json
import time
import subprocess

import version

pulls_url = "https://api.github.com/repos/hawkthorne/hawkthorne-journey/pulls"
compare_url = "https://github.com/hawkthorne/hawkthorne-journey/compare/{}...{}"
GITHUB_TIME = "%Y-%m-%dT%H:%M:%SZ"


def post_content(base, head):
if base is None or head is None:
url = ""
else:
url = compare_url(base, head)

resp = requests.get(pulls_url, params={'state': 'closed', 'base': 'release'})
pulls = resp.json()

if not pulls:
raise ValueError(('No pull request for this release, which means no'
'post'))

return pulls[0]['body'] + "\n" + url


def commithash(version):
bucket = boto.s3.get_bucket("files.projecthawkthorne.com")
key = bucket.get_key("releases/v{}/hawkthorne-osx.zip".format(version))

if key is None:
return key

return key.get_contents()


def main():
parser = argparse.ArgumentParser()
parser.add_argument('commit_hash')
parser.add_argument('output', type=argparse.FileType('w'))
args = parser.parse_args()

prevous_hash = commithash(version.prev_version)

args.output.write(post_content(previous_hash, args.commit_hash))


if __name__ == "__main__":
main()
47 changes: 47 additions & 0 deletions scripts/productionize.py
@@ -0,0 +1,47 @@
import os
import jinja2
import version
import logging

MIXPANEL_DEV = 'ac1c2db50f1332444fd0cafffd7a5543'
MIXPANEL_TOKEN = os.environ.get('MIXPANEL_TOKEN', MIXPANEL_DEV)


def create_main_lua():
with open('src/main.lua') as infile:
contents = infile.read()

with open('src/main.lua', 'w') as outfile:
outfile.write(contents.replace(MIXPANEL_DEV, MIXPANEL_TOKEN))


def create_conf_lua(version):
template = jinja2.Template(open('templates/conf.lua').read())

with open('src/conf.lua', 'w') as f:
f.write(template.render(version=version))


def create_info_plist(version):
template = jinja2.Template(open('templates/Info.plist').read())

with open('osx/Info.plist', 'w') as f:
f.write(template.render(version=version))


def main():
v = version.next_version()

logging.info("Creating osx/Info.plist")
create_info_plist(v)

logging.info("Creating src/conf.lua")
create_conf_lua(v)

logging.info("Creating src/main.lua")
create_main_lua()


if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
main()