This repository has been archived by the owner on Nov 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
74 lines (66 loc) · 3.19 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
services:
- docker
env:
# Use this to set your game's name. It is being used
# throughout this file for naming exported artifacts.
# This will, for example, create an "Awesome Game.exe"
- GAME_NAME="Anno2018"
install:
- docker pull gamedrivendesign/godot-export
# Download Gut
before_script:
- wget https://github.com/bitwes/Gut/archive/v6.3.0.zip -O /tmp/gut.zip
- unzip /tmp/gut.zip -d /tmp
- mv /tmp/Gut-6.3.0/addons $TRAVIS_BUILD_DIR
# Each of the following lines exports the game for a given platform.
# You can specify the platform in the EXPORT_NAME variable
# The exported game will be written to the folder specified after the second "-v" flag
# "-v $(pwd)/output/html5:/build/output" writes the exported game to the "output/html5" folder.
script:
# Run unit tests
- docker run -v $(pwd):/build/src gamedrivendesign/godot-export /build/godot --path /build/src -d -s /build/src/addons/gut/gut_cmdln.gd
# (Try to) export the game
#- docker run -e EXPORT_NAME="HTML5" -e OUTPUT_FILENAME="index.html" -v $(pwd):/build/src -v $(pwd)/output/html5:/build/output gamedrivendesign/godot-export
- docker run -e EXPORT_NAME="Linux/X11" -e OUTPUT_FILENAME="${GAME_NAME}" -v $(pwd):/build/src -v $(pwd)/output/linux:/build/output gamedrivendesign/godot-export
- docker run -e EXPORT_NAME="Windows Desktop" -e OUTPUT_FILENAME="${GAME_NAME}.exe" -v $(pwd):/build/src -v $(pwd)/output/windows:/build/output gamedrivendesign/godot-export
- docker run -e EXPORT_NAME="Mac OSX" -e OUTPUT_FILENAME="${GAME_NAME}-mac.zip" -v $(pwd):/build/src -v $(pwd)/output/mac:/build/output gamedrivendesign/godot-export
# Now comes deployment related code.
# To make this work, you need to set a GITHUB_TOKEN environment variable through
# the TravisCI web ui. For more information take a look at the TravisCI docs:
# https://docs.travis-ci.com/user/deployment/pages/#Setting-the-GitHub-token
# This creates zip files from the exported game builds for the
# three desktop platforms
before_deploy:
- zip -j "${GAME_NAME}-linux.zip" output/linux/*
- zip -j "${GAME_NAME}-windows.zip" output/windows/*
# No need to zip the mac game, because it already is a zip
- cp -R output/mac/* .
deploy:
# The following block is responsible to upload the zip files
# created above to GitHub Releases whenever a new git tag
# is created.
- provider: releases
skip-cleanup: true
api_key: $GITHUB_TOKEN
file:
- "${GAME_NAME}-linux.zip"
- "${GAME_NAME}-windows.zip"
- "${GAME_NAME}-mac.zip"
on:
# Create GitHub Releases for new git tags
# regardless of the branch.
all_branches: true
tags: true
# The following block is responsible for pushing the HTML5 version of the game
# to GitHub Pages. To do so, Travis will commit the contents specified in "local-dir"
# to a "gh-pages" branch in your repository. It will then be accessible at:
# username.github.io/reponame if your repo is at github.com/username/reponame.
#- provider: pages
# skip-cleanup: true
# github-token: $GITHUB_TOKEN
# local-dir: output/html5
# on:
# # This will only update the game with new commits from the master branch
# # You can optionally only update the game on new git tags.
# branch: master
# # tags: true