Skip to content

Commit 25ad7a5

Browse files
author
Warren Seymour
committed
Merge branch 'develop'
2 parents ee79d9e + da9adb1 commit 25ad7a5

30 files changed

+453
-310
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,9 @@ $RECYCLE.BIN/
154154

155155
# Mac desktop service store files
156156
.DS_Store
157+
158+
# Ignore dependencies and builds
159+
src/RemoteTech2/*.dll
160+
*.zip
161+
GameData/RemoteTech2/Plugins/RemoteTech2.dll
162+
GameData/build.txt

.travis.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
language: objective-c # force osx machines
2+
3+
os:
4+
- osx
5+
6+
env:
7+
global:
8+
- secure: Q4UfP54tnvoioOnoQElnkUQMd4qQ/2dLLkhnSz35MiwUrraxqrixdh22EWsTmcqD8ntjPI4tt3P9N6On9+qn8D+qYpt+zX5otikfgvXdKCxGJj+q1Nv0rWq6b0P5QGo61vXFV1cH4EOONBDyAq0IbmtjtEISBhQaefFdzaAAk/Y=
9+
- secure: J/M1/WIRgP4GssMr9HS9k7Wr9XUqlo0S+olIVWvr8eY8jxxVbx+ONZbkkjKey2BvC1BRVtRXpbBe+YcPLYe7V1jG5mmm3Lc1B/x5WC54q4KKfoV53m+ARAtaHFYrJY2h4O+GLaysQoCwCG/tAt0GhJmgJgy9IojH4ojJjDOGHCE=
10+
before_install:
11+
- date -u
12+
- uname -a
13+
- export BUILDTAG=`git describe --abbrev=0 --tags`
14+
- env | sort | grep -v ZIPPASSWORD | grep -v GITHUB_TOKEN
15+
16+
install:
17+
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then echo "Should only be on OSX"; exit 1; fi
18+
- ./CI/travis.osx.install.deps.sh # it appears TRAVIS_OS_NAME is unset often, assume we're OSX if not linux
19+
20+
script:
21+
- ./build.remotetech2.sh
22+
23+
# Custom deploy
24+
after_success:
25+
- ./CI/github.build.deploy.sh

CI/github.build.deploy.sh

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#!/bin/bash
2+
3+
# These should be set by Travis
4+
#TRAVIS_BUILD_NUMBER=1
5+
#TRAVIS_BRANCH=master
6+
#TRAVIS_REPO_SLUG="RemoteTechnologiesGroup/RemoteTech"
7+
#TRAVIS_COMMIT=master
8+
#GITHUB_TOKEN="Personal access token from https://github.com/settings/applications"
9+
#TRAVIS_PULL_REQUEST=false
10+
11+
VERSION="build-${TRAVIS_BRANCH}-${TRAVIS_BUILD_NUMBER}"
12+
FILENAME=$(echo "${VERSION}.zip" | tr '/' '_') # else it will fail on branches like chore/travis
13+
14+
python_parse_json() {
15+
# python errors are surpressed for when the key doesn't exist
16+
cat | python -c 'import sys,json;obj=json.load(sys.stdin);print obj[sys.argv[1]];' $1 2>/dev/null
17+
}
18+
19+
if [ -z "$GITHUB_TOKEN" ] || [ -z "$TRAVIS_REPO_SLUG" ] \
20+
|| [ -z "$TRAVIS_BUILD_NUMBER" ] || [ -z "$TRAVIS_BRANCH" ] \
21+
|| [ -z "$TRAVIS_COMMIT" ]
22+
then
23+
echo "GITHUB_TOKEN, TRAVIS_REPO_SLUG, TRAVIS_BUILD_NUMBER and TRAVIS_COMMIT must be set in order to deploy";
24+
echo "Skipping deploy for now";
25+
exit 0; # prevent build failing if unset
26+
fi
27+
28+
if [ "$TRAVIS_PULL_REQUEST" != "false" ]
29+
then
30+
echo "This is a pull request build, it doesn't need to be released."
31+
exit 0; # prevent build fail
32+
fi
33+
34+
if [[ "$TRAVIS_BRANCH" == build* ]]
35+
then
36+
echo "We're already on a 'build branch' (or tag), don't need to deploy again";
37+
exit 0;
38+
fi
39+
40+
echo "Build ${TRAVIS_BUILD_NUMBER} from branch ${TRAVIS_BRANCH} in ${TRAVIS_REPO_SLUG}" > GameData/build.txt
41+
echo "Built from commit ${TRAVIS_COMMIT} with tag ${BUILDTAG}" >> GameData/build.txt
42+
echo "Creating ${FILENAME}"
43+
zip -r "${FILENAME}" GameData/
44+
45+
echo "Attempting to create tag ${VERSION} on ${TRAVIS_REPO_SLUG}"
46+
API_JSON=$(printf '{"tag_name": "%s","target_commitish": "%s","name": "%s","body": "Automated pre-release of branch %s build %s","draft": false,"prerelease": true}' \
47+
$VERSION $TRAVIS_COMMIT $VERSION $TRAVIS_BRANCH $TRAVIS_BUILD_NUMBER)
48+
ADDRESS=$(printf 'https://api.github.com/repos/%s/releases?access_token=%s' $TRAVIS_REPO_SLUG $GITHUB_TOKEN)
49+
50+
REPLY=$(curl --data "$API_JSON" "$ADDRESS");
51+
UPLOAD_ID=$(echo $REPLY | python_parse_json "id")
52+
ERRORS=$(echo $REPLY | python_parse_json "errors");
53+
54+
if [ -n "$ERRORS" ] || [ -z "$REPLY" ] || [ -z "$UPLOAD_ID" ]
55+
then
56+
echo "ERROR: An error occured while setting the tag";
57+
echo $REPLY;
58+
exit 1;
59+
fi
60+
61+
UPLOAD_URL="https://uploads.github.com/repos/${TRAVIS_REPO_SLUG}/releases/${UPLOAD_ID}/assets"
62+
63+
echo "Uploading ${FILENAME} to GitHub repo ${UPLOAD_ID} (tag ${VERSION} on ${TRAVIS_REPO_SLUG})"
64+
REPLY=$(curl -H "Authorization: token ${GITHUB_TOKEN}" \
65+
-H "Accept: application/vnd.github.manifold-preview" \
66+
-H "Content-Type: application/zip" \
67+
--data-binary @${FILENAME} \
68+
"${UPLOAD_URL}?name=${FILENAME}")
69+
70+
ERRORS=$(echo $REPLY | python_parse_json "errors")
71+
ASSET_ID=$(echo $REPLY | python_parse_json "id" )
72+
73+
if [ -n "$ERRORS" ] || [ -z "$REPLY" ] || [ -z "$ASSET_ID" ]
74+
then
75+
echo "ERROR: An error occured while uploading the file to GitHub";
76+
echo $REPLY;
77+
exit 1;
78+
fi
79+
80+
echo "Uploaded ${FILENAME} to ${TRAVIS_REPO_SLUG} as asset id ${ASSET_ID}"

CI/travis.osx.install.deps.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
set -ev
3+
4+
MONO_VERSION="3.4.0"
5+
6+
echo "Installing Mono ${MONO_VERSION}"
7+
wget "http://download.mono-project.com/archive/${MONO_VERSION}/macos-10-x86/MonoFramework-MDK-${MONO_VERSION}.macos10.xamarin.x86.pkg"
8+
sudo installer -pkg "MonoFramework-MDK-${MONO_VERSION}.macos10.xamarin.x86.pkg" -target /

GameData/ModuleManager.2.1.5.dll

40 KB
Binary file not shown.

GameData/ModuleManager_1_5.dll

-13.5 KB
Binary file not shown.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"NAME": "RemoteTech",
3+
"URL": "https://raw.githubusercontent.com/RemoteTechnologiesGroup/RemoteTech/master/GameData/RemoteTech2/RemoteTech.version",
4+
"DOWNLOAD": "https://github.com/RemoteTechnologiesGroup/RemoteTech/releases/latest",
5+
"_comment": "Use old-style format to keep compatibility with KSP-AVC Utility 0.3.",
6+
"VERSION": {
7+
"MAJOR": 1,
8+
"MINOR": 3,
9+
"PATCH": 3
10+
},
11+
"KSP_VERSION": {
12+
"MAJOR": 0,
13+
"MINOR": 23,
14+
"PATCH": 5
15+
}
16+
}
1.91 KB
Loading
-548 Bytes
Loading
-561 Bytes
Loading

0 commit comments

Comments
 (0)