Skip to content

Feature/ci artifact upload #78

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

Merged
merged 15 commits into from
Sep 25, 2016
15 changes: 14 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ addons:
packages:
- gcc-5
- g++-5
- zip
env: COMPILER=g++-5

before_script:
Expand All @@ -18,10 +19,22 @@ before_script:
- cd Build

script: make -j 3 CXX=g++-5 CC=gcc-5 config=release_x64


after_success:
- cd ..
- ./premake5 install_data
- ./premake5 compose_files
- zip -r Artifact.zip InstallFiles/
- 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

notifications:
irc:
channels:
- "irc.gtanet.com#mta.dev"
on_success: change
on_failure: always

env:
matrix:
secure: fk2kDz4BD3S4cuUihwn7D+rr8X0ZGltahpYJfZzCL5teSJmwIuJOprlsP92x9eacWLzbOdy1cQxj6FfVIeRxiy2hdyx1q+tloA1i7v+rQmErxzPEkSMMJ2dHemUvG5FzfvH5ZzUarFBZwezIxI78eTs5JLBcwoAVMVIJumoqGqI=

8 changes: 7 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ before_build:
after_build:
- utils\premake5 install_data
- utils\premake5 compose_files
- 7z a InstallFiles.zip InstallFiles
- 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

clone_depth: 1

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

artifacts:
- path: InstallFiles
- path: InstallFiles.zip
name: MTASA

environment:
UPLOAD_SECRET:
secure: 5PjW2ChD6CvgnKi1T4d19cV6cX8SN6d8N/keVeszzmQ=
12 changes: 7 additions & 5 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ workspace "MTASA"
defines { "MTA_DEBUG" }
targetsuffix "_d"

if not CI_BUILD then
-- Only optimize outside of CI Builds
filter "configurations:Release or configurations:Nightly"
flags { "Optimize" }
else
filter "configurations:Release or configurations:Nightly"
flags { "Optimize" }

if CI_BUILD then
filter {}
defines { "CI_BUILD=1" }

filter { "system:linux" }
linkoptions { "-s" }
end

filter {"system:windows", "configurations:Nightly", "kind:not StaticLib"}
Expand Down
28 changes: 18 additions & 10 deletions utils/buildactions/compose_files.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ premake.modules.compose_files = {}
local BIN_DIR = "Bin"
local DATA_DIR = "Shared/data/MTA San Andreas"
local OUTPUT_DIR = "InstallFiles"
local WINDOWS = os.get() == "windows"

newaction {
trigger = "compose_files",
Expand All @@ -15,22 +16,29 @@ newaction {
os.mkdir(OUTPUT_DIR)

-- Copy data files
os.copydir(DATA_DIR.."/MTA", OUTPUT_DIR.."/MTA")
os.copydir(DATA_DIR.."/skins/Classic", OUTPUT_DIR.."/skins/Default", "*.xml")
os.copydir(DATA_DIR.."/server/mods/deathmatch", OUTPUT_DIR.."/server/mods/deathmatch", "*.dll")
os.copydir(DATA_DIR.."/redist", OUTPUT_DIR.."/redist")

if WINDOWS then
os.copydir(DATA_DIR.."/MTA", OUTPUT_DIR.."/MTA")
os.copydir(DATA_DIR.."/skins", OUTPUT_DIR.."/skins")
os.copydir(DATA_DIR.."/server/mods/deathmatch", OUTPUT_DIR.."/server/mods/deathmatch", "*.dll")
os.copydir(DATA_DIR.."/redist", OUTPUT_DIR.."/redist")
end

-- Copy configs
os.copydir("Server/mods/deathmatch", OUTPUT_DIR.."/server/mods/deathmatch", "*.conf")
os.copydir("Server/mods/deathmatch", OUTPUT_DIR.."/server/mods/deathmatch", "*.xml")

-- Copy compiled binaries
os.copydir(BIN_DIR, OUTPUT_DIR, "**.exe")
os.copydir(BIN_DIR, OUTPUT_DIR, "**.dll")
os.copydir(BIN_DIR, OUTPUT_DIR, "**.pak")

if WINDOWS then
os.copydir(BIN_DIR, OUTPUT_DIR, "**.exe")
os.copydir(BIN_DIR, OUTPUT_DIR, "**.dll")
os.copydir(BIN_DIR, OUTPUT_DIR, "**.pak")
else
os.copydir(BIN_DIR, OUTPUT_DIR, "**.so")
os.copydir(BIN_DIR, OUTPUT_DIR, "**mta-server*")
end

-- Copy publicsdk
os.copydir("Shared/publicsdk", OUTPUT_DIR.."/development/publicsdk")
-- os.copydir("Shared/publicsdk", OUTPUT_DIR.."/development/publicsdk")
end
}

Expand Down
6 changes: 4 additions & 2 deletions utils/buildactions/install_data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ newaction {
os.mkdir(BIN_DIR)

-- Copy data files
os.copydir(DATA_DIR, BIN_DIR)

if os.get() == "windows" then
os.copydir(DATA_DIR, BIN_DIR)
end

-- Copy configs
os.copydir("Server/mods/deathmatch", BIN_DIR.."/server/mods/deathmatch", "*.conf")
os.copydir("Server/mods/deathmatch", BIN_DIR.."/server/mods/deathmatch", "*.xml")
Expand Down