Skip to content

Commit

Permalink
Merge pull request #41 from Unix4ever/feature/automatic-release-packa…
Browse files Browse the repository at this point in the history
…ging-#164132100

[#164132100] Automatic release packaging
  • Loading branch information
Unix4ever authored Jun 23, 2019
2 parents a07b386 + cafcd60 commit c6d4c5b
Show file tree
Hide file tree
Showing 37 changed files with 649 additions and 187 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ conan_imports_manifest.txt
logs/
.deps
.repo
Core/include/Version.h
resources/editor/gsage.desktop
**/.materials.index
**/.luarocks
package
132 changes: 78 additions & 54 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,94 @@
language: cpp
python:
- "3.6"
- '3.6'
services:
- xvfb
- xvfb
matrix:
include:
- compiler: gcc
dist: xenial
sudo: required
env:
- GSAGE_VERSION_BUILD=${TRAVIS_BUILD_NUMBER}
addons:
apt:
packages:
# install toolchains
- xvfb
- cmake
- gcc
- g++
- clang-3.6
- libglu-dev
- libois-dev
- python-dev
- libxt-dev
- libxaw7-dev
- libxrandr-dev
- libglu-dev
- libglew-dev

- compiler: clang
os: osx
osx_image: xcode9.1
env:
- OGRE_ENABLED=0
- GSAGE_VERSION_BUILD=${TRAVIS_BUILD_NUMBER}

- compiler: gcc
dist: xenial
sudo: required
env:
- GSAGE_VERSION_BUILD=${TRAVIS_BUILD_NUMBER}
- BINARY_EXTENSION=deb
- OGRE_VERSION=2.1.0
addons:
apt:
packages:
- xvfb
- cmake
- gcc
- g++
- clang-3.6
- libglu-dev
- libois-dev
- python-dev
- libxt-dev
- libxaw7-dev
- libxrandr-dev
- libglu-dev
- libglew-dev
- compiler: clang
os: osx
osx_image: xcode9.1
env:
- OGRE_ENABLED=0
- GSAGE_VERSION_BUILD=${TRAVIS_BUILD_NUMBER}
- BINARY_EXTENSION=dmg
- OGRE_VERSION=2.1.0
before_install:
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update
brew install glew
brew install conan
fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo pip install --ignore-installed conan; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then ( sudo Xvfb :99 -ac -screen 0 1024x768x8; echo "Started Xvfb" ) & fi
- sleep 3
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update
brew install glew
brew install conan
fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo pip install --ignore-installed conan;
fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then ( sudo Xvfb :99 -ac -screen 0 1024x768x8;
echo "Started Xvfb" ) & fi
- sleep 3
install:
- make upload-deps
- make upload-deps
script:
- make ci
- |
if [ "$TRAVIS_OS_NAME" == "linux" -a $(git branch | grep \* | cut -d ' ' -f2) == "master" ]; then
go get github.com/calmh/git-autotag
git fetch --tags
git autotag -l patch
GITHUB_TOKEN=1f64968a87c7fbfd2c810cf645a1cc4f696ce565 git push origin --tags
- conan build .
- make unit functional
- |
# run autotag on Linux master
if [ "$TRAVIS_OS_NAME" == "linux" -a $(git branch | grep \* | cut -d ' ' -f2) == "master" ]; then
go get github.com/calmh/git-autotag
git fetch --tags
git autotag -l patch
git push origin --tags
echo "Version bumped"
fi
- |-
if [ -n "$TRAVIS_TAG" ]; then
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
./tools/osx_post_install.sh build/bin/gsage.app
fi
cd build
cpack .
fi
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/5ec885fc0b74db2feac0
- https://webhooks.gitter.im/e/5ec885fc0b74db2feac0
on_success: change
on_failure: always
on_start: never
after_failure:
- find ./ -name "*.log" | xargs cat
branches:
exclude:
- /^\d+.\d+.[\d\w]+$/
- find ./ -name "*.log" | xargs cat
env:
matrix:
secure: qw5QOLFhlZ671wBC0k79FfAurMvV27gsN15/+5hX8eR/YxEUfI4RoOGhJaxPec8t+8y3fKAE3+WWP7mWzJ0EFR8hzsnYyVSh9Rmm5hRNu5FR0Zpl9tYkl0TfBUB6bDpIM3a8JGbNgDu/+ipxOGRLYzzHJNiUTyFPoGaJWwQ/2T9uEhot0yJ9LwGXbd48EEf5pU6uH2ZEHHRFTmPlQDC4IWnoYvoKZN6jrWbY8YmQPyMiX0mYO2Q8lIu5TS7kxFNBlEL1sL8+xJANDTrP8l5lCIt8dbTYExLyK3jEUmHJqti6ofSA28voHqhkyTQ0d0ZQZh7Wvr9KcagWUj5EjZSaBbNvBH+uoqLxgfVvUU0Lo5BI64QyOwY6qre4N92xkcDOhrtVez99tGeDsIcg5RL27qCBSCubfDr1mNL/Vbh5DsBUbvFP8L4IvigceDf81wDDpAqZdIQ32u4pzh/aBSrHcJJoIPpN961HrS0KbsfM4+emgmX8N0eXQjRza5sZRWJ9kUzE5ffRnlUCL3W+b+u98hUm14tliGQdCzs6mUbMaXgS4utexNrk4A8vfHWNNfr+ckHhQUCrRJ8BrWaq/+PT9pn9unRXpDOu+qePlXEdXWmIDVTWkCfHExeyXb7XNV1a3nBv/YiXpkzCJvly0gHhqvvq2OjxoYQYjKd1UcAfqnQ=
deploy:
provider: releases
skip_cleanup: true
file_glob: true
file: $TRAVIS_BUILD_DIR/build/*.$BINARY_EXTENSION
overwrite: true
on:
tags: true
api_key:
secure: BHsiaDd4YG7eqPveYufl8Ic6mtoo0SEvrjtsifUJSRnYsEzI4ozVQmbGHNEciCHpdny/NWkM8UMRbXwnp0bPIKC0jqJLUiReXjCchdL373rl4zp0mF0CsTzAXX6brS1W6/Q5Ud/ljKcNZH/5X/WcomxfnT1WkCy0W1NDQYhJR/keGZIGYs9N0un0VGwpUb6cllKLhLamR5KDiCaD2ROzo6mf+kWL2B5iDXrL9IfdiCik8Oy315vG1NIiZjTgUXowSgyss2rC2H/SRTiMlruHaTnncIcVh8kZ8MP+P/y8uKiB7l/xHCeDlopGJZZWgWAsHKVDNuUxev/PPNUA5CNvRAk9yYDf+8NMnZQaUGrrqXiLvQZeS81LAzdwdnqTAhxh6G8lc+lxFXoukJgYBrtj0ILrlYdOqMU1ZqvgUapvkv8/Lys+R8utYPv74/GX7+a01jKuyfQ2Ct7ViL0yiYUx2DSJZHFxbgOXaYyOZNUUvEe26+O0bMqpyP3oP+/Zw+TmFgbGu2Bp9S0x28NHARlJco6RjmED0d3akZwmAZ4dM+6ZL27xgC9tIsHtE5Ib5M4X31zALrlcSAEVOs9+ES6Olff3gpjPCWlm7gjMrySIhY8Khr0DLEARe5MSdXd/N9MBOs0pCLdHyVi/CbF5D7hdf8UrBfPXlGlyKMKh+mynetw=
45 changes: 45 additions & 0 deletions CMakeDSStore.oas
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
on run argv
set image_name to item 1 of argv

tell application "Finder"
tell disk image_name

-- open the image the first time and save a DS_Store with just
-- background and icon setup
open
set current view of container window to icon view
set theViewOptions to the icon view options of container window
set background picture of theViewOptions to file ".background:background.png"
set arrangement of theViewOptions to not arranged
set icon size of theViewOptions to 128
delay 1
close

-- next setup the position of the app and Applications symlink
-- plus hide all the window decoration
open
update without registering applications
tell container window
set sidebar width to 0
set statusbar visible to false
set toolbar visible to false
set the bounds to { 400, 100, 950, 500 }
set position of item "gsage.app" to { 34, 255 }
set position of item "Applications" to { 334, 255 }
set position of item ".background" to { 0, 700 }
set position of item ".fseventsd" to { 0, 700 }
end tell
update without registering applications
delay 1
close

-- one last open and close so you can see everything looks correct
open
delay 5
close

end tell
delay 1
end tell
end run

53 changes: 47 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ configure()
include(${CMAKE_SOURCE_DIR}/conanbuildinfo.cmake OPTIONAL)

if(CONAN_PACKAGE_NAME)
set(CMAKE_INSTALL_PATH "${CMAKE_BINARY_DIR}/sdk")
set(CMAKE_INSTALL_PATH "./")
include(cmake/ConanDependencies.cmake)
else(CONAN_PACKAGE_NAME)
set(CMAKE_INSTALL_PATH "/usr/local")
Expand All @@ -24,10 +24,51 @@ add_subdirectory(Tests)
add_subdirectory(Vendor)
if(OGRE_FOUND)
add_subdirectory(Editor)

if(Qt5_FOUND)
add_subdirectory(QEditor)
endif(Qt5_FOUND)
endif(OGRE_FOUND)

install(DIRECTORY cmake DESTINATION "${CMAKE_INSTALL_PATH}/share/gsage")
set(CPACK_PACKAGE_NAME "GSAGE Engine")
set(CPACK_PACKAGE_VERSION_MAJOR ${GSAGE_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${GSAGE_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${GSAGE_VERSION_PATCH})

set(CPACK_COMPONENT_resources_REQUIRED true)

set(CPACK_CREATE_DESKTOP_LINKS gsage)
set(CPACK_PACKAGE_EXECUTABLES gsage "GSAGE Editor")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")

install_resources()

if(WIN32)
# pack
set(A_PACK_DESCRIPTION_SUMMARY "GSAGE engine")
set(CPACK_COMPONENTS_ALL Unspecified gsage game headers packager resources)

set(CPACK_WIX_PRODUCT_ICON "${CMAKE_SOURCE_DIR}/resources/editor/gsage.ico")
set(CPACK_WIX_PRODUCT_GUID "1A33E980-D505-41A4-B4E1-B70D96E2DC4E")
set(CPACK_WIX_UPGRADE_GUID "1A33E980-D505-41A4-B4E1-B70D96E2DC4F")
set(CPACK_WIX_LICENSE_RTF "${CMAKE_SOURCE_DIR}/resources/editor/license.rtf")

set(CPACK_GENERATOR "WIX")
endif(WIN32)

if(APPLE)
set(CPACK_COMPONENTS_ALL gsage)
set(CPACK_DMG_BACKGROUND_IMAGE ${gsage_SOURCE_DIR}/resources/editor/dmgbg.png)
set(CPACK_DMG_DS_STORE_SETUP_SCRIPT ${gsage_SOURCE_DIR}/CMakeDSStore.oas)
set(CPACK_DMG_VOLUME_NAME "GSAGE engine")

set(CPACK_GENERATOR "DragNDrop")
elseif(UNIX)
set(CPACK_COMPONENTS_ALL Unspecified gsage game headers packager resources)
set(CPACK_DEBIAN_PACKAGE_NAME "gsage")
set(CPACK_DEBIAN_PACKAGE_VERSION "${GSAGE_VERSION_MAJOR}.${GSAGE_VERSION_MINOR}.${GSAGE_VERSION_PATCH}")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Artem Chernyshev")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Open source game engine")

set(CPACK_GENERATOR "DEB")
endif(APPLE)


include(CPack)
37 changes: 16 additions & 21 deletions Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ include_directories(
${POCO_INCLUDE_DIRS}
)

add_library(${LIB_NAME} SHARED ${headers} ${sources})
gsage_library(${LIB_NAME} SHARED ${sources})

set_target_properties(${LIB_NAME} PROPERTIES DEBUG_POSTFIX _d COMPILE_FLAGS -DGSAGE_DLL_EXPORT)

Expand All @@ -41,7 +41,9 @@ set(LIBS

if(APPLE)
set(LIBS ${LIBS}
${COREFOUNDATION_LIBRARY})
${COREFOUNDATION_LIBRARY}
${COCOA_LIBRARY}
)
elseif(UNIX)
find_package(Threads REQUIRED)
set(LIBS ${CMAKE_DL_LIBS}
Expand All @@ -57,29 +59,23 @@ target_link_libraries(
${LIBS}
)

install(DIRECTORY include/ DESTINATION include/gsage
FILES_MATCHING PATTERN "*.h"
)

install(DIRECTORY ${gsage_SOURCE_DIR}/Vendor/jsoncpp/include/json DESTINATION include/gsage
FILES_MATCHING PATTERN "*.h"
)

install(DIRECTORY ${gsage_SOURCE_DIR}/Vendor/Sol2/include/ DESTINATION include/gsage
FILES_MATCHING PATTERN "*.hpp"
install_includes(
include/
${gsage_SOURCE_DIR}/Vendor/jsoncpp/include/json
${gsage_SOURCE_DIR}/Vendor/Sol2/include/
)

install(TARGETS ${LIB_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/static)
install(TARGETS ${LIB_NAME} DESTINATION "${CMAKE_INSTALL_PATH}/lib")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/Version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/include/Version.h)

set(APP_NAME "game")
set(PACKAGER_NAME "packager")

gsage_executable(${APP_NAME} cmd/app.cpp)
console_executable(${PACKAGER_NAME} cmd/packager.cpp)
if(WIN32)
console_executable(${PACKAGER_NAME} cmd/packager.cpp ${gsage_SOURCE_DIR}/resources/editor/packager.ico ${gsage_SOURCE_DIR}/resources/editor/packager.rc)
else(WIN32)
console_executable(${PACKAGER_NAME} cmd/packager.cpp)
endif(WIN32)

set(LIBS
GsageCore
Expand All @@ -88,13 +84,12 @@ set(LIBS
)

if(APPLE)
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/Main.cpp PROPERTIES COMPILE_FLAGS "-x objective-c++")
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/cmd/app.cpp PROPERTIES COMPILE_FLAGS "-x objective-c++")
set(LIBS ${LIBS}
${COREFOUNDATION_LIBRARY}
${CARBON}
${IOKIT}
${COCOA_LIBRARY}
)
)
endif(APPLE)

target_link_libraries(${APP_NAME} ${LIBS})
Expand Down
24 changes: 24 additions & 0 deletions Core/Info.plist.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleGetInfoString</key>
<string>GSAGE Framework</string>
<key>CFBundleIdentifier</key>
<string>org.gsage.engine.GsageCore</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>GSAGE</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>${GSAGE_VERSION_MAJOR}.${GSAGE_VERSION_MINOR}.${GSAGE_VERSION_BUILD}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${GSAGE_VERSION_MAJOR}.${GSAGE_VERSION_MINOR}.${GSAGE_VERSION_BUILD}</string>
</dict>
</plist>
12 changes: 0 additions & 12 deletions Core/include/GsageDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,6 @@ THE SOFTWARE.
#define COMPONENT_POOL_SIZE 1024
#define NOMINMAX

#ifndef GSAGE_VERSION_MAJOR
#define GSAGE_VERSION_MAJOR 0
#endif

#ifndef GSAGE_VERSION_MINOR
#define GSAGE_VERSION_MINOR 0
#endif

#ifndef GSAGE_VERSION_BUILD
#define GSAGE_VERSION_BUILD 0
#endif

#include <sstream>
#include <istream>
#include <iterator>
Expand Down
Loading

0 comments on commit c6d4c5b

Please sign in to comment.