diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 000000000..53ffd7cce --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,18 @@ +[bumpversion] +current_version = 0.10.0.dev3 +commit = True +tag = True +parse = (?P\d+)\.(?P\d+)\.(?P\d+)((?Prc|\.dev)(?P\d+))? +serialize = + {major}.{minor}.{patch}{prerel}{prerelver} + {major}.{minor}.{patch} + +[bumpversion:part:prerel] +optional_value = rel +values = + .dev + rc + rel + +[bumpversion:file:CMakeLists.txt] + diff --git a/.travis.yml b/.travis.yml index 9228374dc..58214eb8f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: cpp branches: only: + - /^v\d+\..+$/ - master matrix: include: @@ -25,3 +26,14 @@ script: - build/ethminer/ethminer --list-devices -U - if [ "$TRAVIS_OS_NAME" = linux ]; then ldd -v build/ethminer/ethminer; fi - if [ "$TRAVIS_OS_NAME" = osx ]; then otool -L build/ethminer/ethminer; fi + - cmake --build build --target package + +deploy: + provider: releases + api_key: + secure: "KfYTW8o20BUEZc57vF3H4+qXgpDsMeWk3N4IQtNKkdhFzEUzQaXi1WHRtvcR5kq+rvDiXwy0fELglDZpCSa4wfQvM5fKlb7WPQgkyRZyCpwnXlqvb6dL8KxJekQHZ5fFpzc/ow0dx/UqzJgv+cWDnBEK/gl+9j+vt9oq1nV1LSaxmtO3Qs7y+ffq5Tbzo06q6/CfeyOZi23g+AYtnoEBKwYqa807atWM6cJpudPmyhYHQFgaQZMfzk44z/MnJb7nxtkqcx57KWaY2EHlFj6yrHMcXWyM8j+P0ZBwUbOpHkWvBpgmDKR2J3u0WmiJDDo3E6K0g9QgbAnF5+yqvpBC5kaSHAaicJ3+7ghSgo18Eea0BkLbmb0t93h5NJfRhg0GDjgG3LkHao9ALM35x3OXG38JI6bOLd6jSV2Vkg8qLWAZjP1TUb/4VTIFnyITSv+xrY7ZP9D0XcRybZ5Z0YnaI/J6NFJct9ICAlQ6cHkS0MO6PICTSbZbKhbDZP0Lt6iDDUeje5+uvPAl0uuzuciSqEM77JWYN/edOXurgkfljEny3P96AW70gUUBTVEE+4tjng4DMLHCH/1Jg/WfMPfSVC3AUR0WbvjMki6veMt37fy8Jys8gFpwZbMG3cCSkYXDDFWF/Q+p2v6pX76CZZz+LxO2XcZ7x4bw+c7AGzRWV7c=" + file_glob: true + file: build/ethminer-*.tar.gz + skip_cleanup: true + on: + tags: true diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f6f5aed1..3fa768d38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,10 +14,8 @@ HunterGate( ) -cmake_policy(SET CMP0042 OLD) # fix MACOSX_RPATH -cmake_policy(SET CMP0048 NEW) # allow VERSION argument in project() - -project(ethminer VERSION 0.10.0) +project(ethminer) +set(PROJECT_VERSION 0.10.0.dev3) # link_directories interprate relative paths with respect to CMAKE_CURRENT_SOURCE_DIR cmake_policy(SET CMP0015 NEW) @@ -123,3 +121,25 @@ if(ETHSTRATUM) endif() add_subdirectory(libethcore) add_subdirectory(ethminer) + + +if(WIN32) + set(CPACK_GENERATOR ZIP) +else() + set(CPACK_GENERATOR TGZ) +endif() +set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${PROJECT_VERSION}-${CMAKE_SYSTEM_NAME}) +set(CPACK_PACKAGE_CHECKSUM SHA256) +set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY FALSE) +include(CPack) + + +# Export some variables for CIs +if(PROJECT_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$") + set(PROJECT_VERSION_IS_PRERELEASE false) +else() + set(PROJECT_VERSION_IS_PRERELEASE true) +endif() +message("Prerelease: ${PROJECT_VERSION_IS_PRERELEASE}") +configure_file(cmake/variables.sh.in variables.sh) +configure_file(cmake/variables.ps1.in variables.ps1) \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 8fc889ced..4f3cd133a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,6 +2,7 @@ version: "{build}" branches: only: - master + - /v\d+\..+/ os: Visual Studio 2015 configuration: - Release @@ -10,10 +11,29 @@ cache: install: before_build: - cmake -G "Visual Studio 14 2015 Win64" -H. -Bbuild -build: - project: c:/projects/ethminer/build/ethminer.sln - parallel: true - verbosity: minimal +build_script: + - cmake --build build --config Release +after_build: + - cmake --build build --config Release --target package + artifacts: - - path: build/ethminer/Release/ethminer.exe + - path: build/ethminer-*.zip name: ethminer + +before_deploy: + # Read variables dumped by CMake configuration. + - ps: . build/variables.ps1 +deploy: + # Create GitHub release, also set the release name and description. + provider: GitHub + tag: $(appveyor_repo_tag_name) + release: ethminer $(ethminer_version) + description: '' + force_update: true # Force update in case Travis CI created the release before. + prerelease: $(ethminer_version_is_prerelease) + draft: false + artifact: ethminer + auth_token: + secure: uDRcvbW+9GIyKlZ9guJfWOQ6jg0An6eULg6mEkYgdKn/GVNpYSKvO5oHxP0U8a+e + on: + appveyor_repo_tag: true diff --git a/cmake/variables.ps1.in b/cmake/variables.ps1.in new file mode 100644 index 000000000..4f38b7a79 --- /dev/null +++ b/cmake/variables.ps1.in @@ -0,0 +1,2 @@ +$env:ethminer_version="@PROJECT_VERSION@" +$env:ethminer_version_is_prerelease="@PROJECT_VERSION_IS_PRERELEASE@" diff --git a/cmake/variables.sh.in b/cmake/variables.sh.in new file mode 100644 index 000000000..c563a9e5e --- /dev/null +++ b/cmake/variables.sh.in @@ -0,0 +1,2 @@ +ETHMINER_VERSION='@PROJECT_VERSION@' +ETHMINER_VERSION_IS_PRERELEASE='@PROJECT_VERSION_IS_PRERELEASE@' \ No newline at end of file