Skip to content
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

1686: Add support for generating and uploading checksum files for releases #1693

Merged
merged 8 commits into from
Jan 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ deploy:
- "build/*.deb"
- "build/*.rpm"
- "build/*.dmg"
- "build/*.md5"
on:
repo: kduske/TrenchBroom
tags: true
23 changes: 23 additions & 0 deletions appveyor.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
PATH=%PATH%;c:\wxWidgets-3.1.0\lib\vc140_dll
PATH=%PATH%;C:\Program Files (x86)\Pandoc
SET WXWIN="c:\wxWidgets-3.1.0"

mkdir cmakebuild
cd cmakebuild

cmake .. -G"Visual Studio 14 2015" -T v140_xp -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=/WX
msbuild PACKAGE.vcxproj /p:Configuration=Release /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"

IF ERRORLEVEL 1 GOTO ERROR

call generate_checksum.bat

Release\TrenchBroom-Test.exe

GOTO END

:ERROR

echo "Building TrenchBroom failed"

:END
22 changes: 3 additions & 19 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 2.0.0-appveyor-{build}
install:
- cinst pandoc
- cinst pandoc
- ps: Invoke-WebRequest 'https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.0/wxWidgets-3.1.0-headers.7z' -OutFile 'headers.7z'
- ps: Invoke-WebRequest 'https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.0/wxMSW-3.1.0_vc140_Dev.7z' -OutFile 'dev.7z'
- ps: Invoke-WebRequest 'https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.0/wxMSW-3.1.0_vc140_ReleaseDLL.7z' -OutFile 'dll.7z'
Expand All @@ -14,26 +14,10 @@ install:
- ps: 7z x dll.7z -oc:\wxWidgets-3.1.0
- ps: 7z x pdb.7z -oc:\wxWidgets-3.1.0
build_script:
- ps: >-
$env:Path += ";c:\wxWidgets-3.1.0\lib\vc140_dll"

$env:WXWIN="c:\wxWidgets-3.1.0"

$env:Path += ";C:\Program Files (x86)\Pandoc"

mkdir cmakebuild

cd cmakebuild

cmake .. -G"Visual Studio 14 2015" -T v140_xp -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=/WX

msbuild PACKAGE.vcxproj /p:Configuration=Release /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"

if ($LastExitCode -ne 0) { throw "Building TrenchBroom failed" }

.\Release\TrenchBroom-Test.exe
- cmd: call appveyor.bat
artifacts:
- path: cmakebuild\*.7z
- path: cmakebuild\*.7z.md5
deploy:
description: 'release description'
provider: GitHub
Expand Down
3 changes: 3 additions & 0 deletions cmake/GenerateChecksum.bat.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off

cmake -E md5sum "@CPACK_PACKAGE_FILE_NAME@.@CPACK_PACKAGE_FILE_EXT@" > "@CPACK_PACKAGE_FILE_NAME@.@CPACK_PACKAGE_FILE_EXT@.md5"
3 changes: 3 additions & 0 deletions cmake/GenerateChecksum.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

cmake -E md5sum "@CPACK_PACKAGE_FILE_NAME@.@CPACK_PACKAGE_FILE_EXT@" > "@CPACK_PACKAGE_FILE_NAME@.@CPACK_PACKAGE_FILE_EXT@.md5"
12 changes: 12 additions & 0 deletions cmake/TrenchBroomApp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,15 @@ IF(WIN32)
DESTINATION . COMPONENT TrenchBroom)
SET(CPACK_GENERATOR "7Z")
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY FALSE)

SET(CPACK_PACKAGE_FILE_EXT "7z")
CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/cmake/GenerateChecksum.bat.in" "${CMAKE_CURRENT_BINARY_DIR}/generate_checksum.bat" @ONLY)
ELSEIF(APPLE)
INSTALL(TARGETS TrenchBroom BUNDLE DESTINATION . COMPONENT TrenchBroom)
SET(CPACK_GENERATOR "DragNDrop")

SET(CPACK_PACKAGE_FILE_EXT "dmg")
CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/cmake/GenerateChecksum.sh.in" "${CMAKE_CURRENT_BINARY_DIR}/generate_checksum.sh" @ONLY)
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# add architecture to filename
SET(APP_PACKAGE_FILE_NAME "${APP_PACKAGE_FILE_NAME}.${CMAKE_SYSTEM_PROCESSOR}")
Expand Down Expand Up @@ -325,5 +331,11 @@ ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
SET(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/linux/prerm")
SET(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/linux/postrm")
SET(CPACK_RPM_SPEC_INSTALL_POST "/bin/true") # prevents stripping of debug symbols during rpmbuild

SET(CPACK_PACKAGE_FILE_EXT "rpm")
CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/cmake/GenerateChecksum.sh.in" "${CMAKE_CURRENT_BINARY_DIR}/generate_checksum_rpm.sh" @ONLY)

SET(CPACK_PACKAGE_FILE_EXT "deb")
CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/cmake/GenerateChecksum.sh.in" "${CMAKE_CURRENT_BINARY_DIR}/generate_checksum_deb.sh" @ONLY)
ENDIF()
INCLUDE(CPack)
3 changes: 3 additions & 0 deletions travis-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-Werror -DwxWidget
ninja || exit 1
cpack || exit 1

./generate_checksum_deb.sh
./generate_checksum_rpm.sh

# Run tests (wxgtk needs an X server running for the app to initialize)

Xvfb :10 &
Expand Down
3 changes: 3 additions & 0 deletions travis-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-Werror -DwxWidgets_PREFIX=$(pwd)/../wxWidgets/build-release/install || exit 1
ninja || exit 1
cpack || exit 1

./generate_checksum.sh

./TrenchBroom-Test || exit 1

echo "Shared libraries used:"
Expand Down