Skip to content

Commit 4e19f53

Browse files
author
Jusonex
authored
Merge feature/ci-artifact-upload (#78)
* Test CI upload * Update compose and travis script * Fix .travis.yml indentation * Fix install_data buildaction on Linux * Tell AppVeyor to upload the artifacts * Fix syntax error * Fix syntax error (2) * Fix syntax errors (3) * Fix artifact zip not being available * Addendum to previous commit * I'm an idiot * Enable optimization for CI builds and fix launcher not being included Also remove publicsdk from artifact upload * Strip symbols in CI builds to get smaller binaries * Fix skins not being copied correctly * Update CI URL and secrets
1 parent 3de7e5b commit 4e19f53

File tree

5 files changed

+50
-19
lines changed

5 files changed

+50
-19
lines changed

.travis.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ addons:
99
packages:
1010
- gcc-5
1111
- g++-5
12+
- zip
1213
env: COMPILER=g++-5
1314

1415
before_script:
@@ -18,10 +19,22 @@ before_script:
1819
- cd Build
1920

2021
script: make -j 3 CXX=g++-5 CC=gcc-5 config=release_x64
21-
22+
23+
after_success:
24+
- cd ..
25+
- ./premake5 install_data
26+
- ./premake5 compose_files
27+
- zip -r Artifact.zip InstallFiles/
28+
- curl -i -F "branch_name=$TRAVIS_BRANCH" -F "commit_hash=$TRAVIS_COMMIT" -F "commit_title=$(git log -1 --pretty=%B)" -F build_type=linux64 -F "secret=$UPLOAD_SECRET" -F build_upload=@Artifact.zip https://nightlytest.mtasa.com/api/upload
29+
2230
notifications:
2331
irc:
2432
channels:
2533
- "irc.gtanet.com#mta.dev"
2634
on_success: change
2735
on_failure: always
36+
37+
env:
38+
matrix:
39+
secure: fk2kDz4BD3S4cuUihwn7D+rr8X0ZGltahpYJfZzCL5teSJmwIuJOprlsP92x9eacWLzbOdy1cQxj6FfVIeRxiy2hdyx1q+tloA1i7v+rQmErxzPEkSMMJ2dHemUvG5FzfvH5ZzUarFBZwezIxI78eTs5JLBcwoAVMVIJumoqGqI=
40+

appveyor.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ before_build:
1111
after_build:
1212
- utils\premake5 install_data
1313
- utils\premake5 compose_files
14+
- 7z a InstallFiles.zip InstallFiles
15+
- cmd: if not %UPLOAD_SECRET% == "" curl -i -F "branch_name=%APPVEYOR_REPO_BRANCH%" -F "commit_hash=%APPVEYOR_REPO_COMMIT%" -F "commit_title=%APPVEYOR_REPO_COMMIT_MESSAGE%" -F build_type=windows32 -F "secret=%UPLOAD_SECRET%" -F build_upload=@InstallFiles.zip https://nightlytest.mtasa.com/api/upload
1416

1517
clone_depth: 1
1618

@@ -24,5 +26,9 @@ notifications:
2426
secure: GMy2h7KrBeqM46INusj3AEZvef5jyFQRUeKqcJjfttHc/Iujje6YN398t7mo5UeMZjkDN2azgcb/R79wU/BvJot8iiu/4AtEBGwLffzrpCw=
2527

2628
artifacts:
27-
- path: InstallFiles
29+
- path: InstallFiles.zip
2830
name: MTASA
31+
32+
environment:
33+
UPLOAD_SECRET:
34+
secure: 5PjW2ChD6CvgnKi1T4d19cV6cX8SN6d8N/keVeszzmQ=

premake5.lua

+7-5
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,15 @@ workspace "MTASA"
5050
defines { "MTA_DEBUG" }
5151
targetsuffix "_d"
5252

53-
if not CI_BUILD then
54-
-- Only optimize outside of CI Builds
55-
filter "configurations:Release or configurations:Nightly"
56-
flags { "Optimize" }
57-
else
53+
filter "configurations:Release or configurations:Nightly"
54+
flags { "Optimize" }
55+
56+
if CI_BUILD then
5857
filter {}
5958
defines { "CI_BUILD=1" }
59+
60+
filter { "system:linux" }
61+
linkoptions { "-s" }
6062
end
6163

6264
filter {"system:windows", "configurations:Nightly", "kind:not StaticLib"}

utils/buildactions/compose_files.lua

+18-10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ premake.modules.compose_files = {}
66
local BIN_DIR = "Bin"
77
local DATA_DIR = "Shared/data/MTA San Andreas"
88
local OUTPUT_DIR = "InstallFiles"
9+
local WINDOWS = os.get() == "windows"
910

1011
newaction {
1112
trigger = "compose_files",
@@ -15,22 +16,29 @@ newaction {
1516
os.mkdir(OUTPUT_DIR)
1617

1718
-- Copy data files
18-
os.copydir(DATA_DIR.."/MTA", OUTPUT_DIR.."/MTA")
19-
os.copydir(DATA_DIR.."/skins/Classic", OUTPUT_DIR.."/skins/Default", "*.xml")
20-
os.copydir(DATA_DIR.."/server/mods/deathmatch", OUTPUT_DIR.."/server/mods/deathmatch", "*.dll")
21-
os.copydir(DATA_DIR.."/redist", OUTPUT_DIR.."/redist")
22-
19+
if WINDOWS then
20+
os.copydir(DATA_DIR.."/MTA", OUTPUT_DIR.."/MTA")
21+
os.copydir(DATA_DIR.."/skins", OUTPUT_DIR.."/skins")
22+
os.copydir(DATA_DIR.."/server/mods/deathmatch", OUTPUT_DIR.."/server/mods/deathmatch", "*.dll")
23+
os.copydir(DATA_DIR.."/redist", OUTPUT_DIR.."/redist")
24+
end
25+
2326
-- Copy configs
2427
os.copydir("Server/mods/deathmatch", OUTPUT_DIR.."/server/mods/deathmatch", "*.conf")
2528
os.copydir("Server/mods/deathmatch", OUTPUT_DIR.."/server/mods/deathmatch", "*.xml")
2629

2730
-- Copy compiled binaries
28-
os.copydir(BIN_DIR, OUTPUT_DIR, "**.exe")
29-
os.copydir(BIN_DIR, OUTPUT_DIR, "**.dll")
30-
os.copydir(BIN_DIR, OUTPUT_DIR, "**.pak")
31-
31+
if WINDOWS then
32+
os.copydir(BIN_DIR, OUTPUT_DIR, "**.exe")
33+
os.copydir(BIN_DIR, OUTPUT_DIR, "**.dll")
34+
os.copydir(BIN_DIR, OUTPUT_DIR, "**.pak")
35+
else
36+
os.copydir(BIN_DIR, OUTPUT_DIR, "**.so")
37+
os.copydir(BIN_DIR, OUTPUT_DIR, "**mta-server*")
38+
end
39+
3240
-- Copy publicsdk
33-
os.copydir("Shared/publicsdk", OUTPUT_DIR.."/development/publicsdk")
41+
-- os.copydir("Shared/publicsdk", OUTPUT_DIR.."/development/publicsdk")
3442
end
3543
}
3644

utils/buildactions/install_data.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ newaction {
2323
os.mkdir(BIN_DIR)
2424

2525
-- Copy data files
26-
os.copydir(DATA_DIR, BIN_DIR)
27-
26+
if os.get() == "windows" then
27+
os.copydir(DATA_DIR, BIN_DIR)
28+
end
29+
2830
-- Copy configs
2931
os.copydir("Server/mods/deathmatch", BIN_DIR.."/server/mods/deathmatch", "*.conf")
3032
os.copydir("Server/mods/deathmatch", BIN_DIR.."/server/mods/deathmatch", "*.xml")

0 commit comments

Comments
 (0)