Add experimental support for linux and macos releases

This commit is contained in:
zhupengfei
2020-06-19 22:55:25 +08:00
parent 5bfe180348
commit ac8a5f447e
10 changed files with 160 additions and 13 deletions
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash -ex
# Copy documentation
cp license.txt "$REV_NAME"
cp README.md "$REV_NAME"
cp dist/threeSDumper.gm9 "$REV_NAME/dist"
tar $COMPRESSION_FLAGS "$ARCHIVE_NAME" "$REV_NAME"
# Find out what release we are building
if [ -z $TRAVIS_TAG ]; then
RELEASE_NAME=head
else
RELEASE_NAME=$(echo $TRAVIS_TAG | cut -d- -f1)
fi
mv "$REV_NAME" $RELEASE_NAME
7z a "$REV_NAME.7z" $RELEASE_NAME
# move the compiled archive into the artifacts directory to be uploaded by travis releases
mv "$ARCHIVE_NAME" artifacts/
mv "$REV_NAME.7z" artifacts/
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash -ex
GITDATE="`git show -s --date=short --format='%ad' | sed 's/-//g'`"
GITREV="`git show -s --format='%h'`"
mkdir -p artifacts
-2
View File
@@ -5,5 +5,3 @@ cd /threeSD
mkdir build && cd build
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++
ninja
ctest -VV -C Release
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash -ex
. .travis/common/pre-upload.sh
REV_NAME="threeSD-linux-${GITDATE}-${GITREV}"
ARCHIVE_NAME="${REV_NAME}.tar.xz"
COMPRESSION_FLAGS="-cJvf"
mkdir "$REV_NAME"
cp build/bin/threeSD "$REV_NAME"
mkdir "$REV_NAME/dist"
. .travis/common/post-upload.sh
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash -ex
set -o pipefail
export MACOSX_DEPLOYMENT_TARGET=10.13
export Qt5_DIR=$(brew --prefix)/opt/qt5
export PATH="/usr/local/opt/ccache/libexec:$PATH"
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j4
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh -ex
brew update
brew unlink python@2
brew install qt5 sdl2 p7zip ccache
pip3 install macpack
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash -ex
. .travis/common/pre-upload.sh
REV_NAME="threeSD-macos-${GITDATE}-${GITREV}"
ARCHIVE_NAME="${REV_NAME}.tar.gz"
COMPRESSION_FLAGS="-czvf"
mkdir "$REV_NAME"
cp -r build/bin/threeSD.app "$REV_NAME"
# move libs into folder for deployment
macpack "${REV_NAME}/threeSD.app/Contents/MacOS/threeSD" -d "../Frameworks"
# move qt frameworks into app bundle for deployment
$(brew --prefix)/opt/qt5/bin/macdeployqt "${REV_NAME}/threeSD.app" -executable="${REV_NAME}/threeSD.app/Contents/MacOS/threeSD"
# Make the launching script executable
chmod +x ${REV_NAME}/threeSD.app/Contents/MacOS/threeSD
# Verify loader instructions
find "$REV_NAME" -exec otool -L {} \;
. .travis/common/post-upload.sh