Create windows installer on Travis.

This commit is contained in:
Pentarctagon 2020-02-09 15:46:36 -06:00 committed by Pentarctagon
parent 51788f3773
commit 204c4b804c
5 changed files with 35 additions and 22 deletions

View file

@ -36,7 +36,7 @@ matrix:
env: TOOL=xcodebuild BRANCH=master
- compiler: gcc
env: CXXSTD=14 NLS=true LTS=1604 BRANCH=master
env: CXXSTD=14 NLS=only LTS=1604 BRANCH=master
- compiler: gcc
env: TOOL=scons CXXSTD=17 NLS=false LTS=1804 BRANCH=master VALIDATE=true UPLOAD_ID=ubuntu-1804
@ -53,7 +53,7 @@ matrix:
- compiler: clang
env: TOOL=cmake CXXSTD=14 NLS=false LTS=1804 BRANCH=master
- env: CXXSTD=14 NLS=false LTS=mingw BRANCH=master STRICT=false UPLOAD_ID=mingw
- env: CXXSTD=14 NLS=true LTS=mingw BRANCH=master STRICT=false UPLOAD_ID=mingw
- env: CXXSTD=14 NLS=false LTS=steamrt BRANCH=master CC=gcc-5 CXX=g++-5

View file

@ -43,13 +43,14 @@ echo "TRAVIS_COMMIT: $TRAVIS_COMMIT"
echo "BRANCH: $BRANCH"
echo "UPLOAD_ID: $UPLOAD_ID"
echo "TRAVIS_PULL_REQUEST: $TRAVIS_PULL_REQUEST"
echo "TRAVIS_TAG: $TRAVIS_TAG"
echo "STRICT: $STRICT"
echo "build_timeout(mins): $build_timeout"
$CXX --version
if [ "$NLS" == "true" ] && [ "$LTS" != "flatpak" ]; then
if [ "$NLS" == "only" ]; then
cmake -DENABLE_NLS=true -DENABLE_GAME=false -DENABLE_SERVER=false -DENABLE_CAMPAIGN_SERVER=false -DENABLE_TESTS=false
make VERBOSE=1 -j2 || exit 1
make clean
@ -73,17 +74,22 @@ elif [ "$LTS" == "mingw" ]; then
scons wesnoth wesnothd build=release \
cxx_std=$CXXSTD opt="$OPT" strict="$STRICT" \
nls=false enable_lto="$LTO" sanitize="$SAN" jobs=2 --debug=time \
arch=x86-64 prefix=/windows/mingw64 gtkdir=/windows/mingw64 host=x86_64-w64-mingw32
BUILD_RET=$?
arch=x86-64 prefix=/windows/mingw64 gtkdir=/windows/mingw64 host=x86_64-w64-mingw32 || exit 1
if [ "$UPLOAD_ID" != "" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
./utils/travis/sftp
./utils/travis/sftp wesnoth.exe wesnothd.exe
fi
exit $BUILD_RET
if [ "$TRAVIS_TAG" != "" ]; then
echo "Creating installer for tag: $TRAVIS_TAG"
scons translations build=release --debug=time nls=true jobs=2 || exit 1
python3 ./utils/dockerbuilds/mingw/get_dlls.py || exit 1
scons windows-installer arch=x86-64 prefix=/windows/mingw64 gtkdir=/windows/mingw64 host=x86_64-w64-mingw32 || exit 1
./utils/travis/sftp "$(find . -type f -regex '.*win64.*')"
fi
elif [ "$LTS" == "steamrt" ]; then
scons ctool=$CC cxxtool=$CXX boostdir=/usr/local/include boostlibdir=/usr/local/lib extra_flags_config=-lrt \
cxx_std=$CXXSTD opt="$OPT" strict="$STRICT" nls=false enable_lto="$LTO" sanitize="$SAN" jobs=2 --debug=time \
cxx_std=$CXXSTD opt="$OPT" strict="$STRICT" nls="$NLS" enable_lto="$LTO" sanitize="$SAN" jobs=2 --debug=time \
build=release
else
SECONDS=0
@ -92,7 +98,7 @@ else
echo "max_size = 200M" > $HOME/.ccache/ccache.conf
echo "compiler_check = content" >> $HOME/.ccache/ccache.conf
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GAME=true -DENABLE_SERVER=true -DENABLE_CAMPAIGN_SERVER=true -DENABLE_TESTS=true -DENABLE_NLS=false \
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GAME=true -DENABLE_SERVER=true -DENABLE_CAMPAIGN_SERVER=true -DENABLE_TESTS=true -DENABLE_NLS="$NLS" \
-DEXTRA_FLAGS_CONFIG="-pipe" -DOPT="$OPT" -DENABLE_STRICT_COMPILATION="$STRICT" -DENABLE_LTO="$LTO" -DLTO_JOBS=2 -DENABLE_MYSQL=true -DSANITIZE="$SAN" \
-DCXX_STD="$CXXSTD" -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache && \
make VERBOSE=1 -j2
@ -104,7 +110,7 @@ else
scons wesnoth wesnothd campaignd boost_unit_tests build=release \
ctool=$CC cxxtool=$CXX cxx_std=$CXXSTD \
extra_flags_config="-pipe" opt="$OPT" strict="$STRICT" forum_user_handler=true \
nls=false enable_lto="$LTO" sanitize="$SAN" jobs=2 --debug=time
nls="$NLS" enable_lto="$LTO" sanitize="$SAN" jobs=2 --debug=time
BUILD_RET=$?
fi
@ -113,7 +119,7 @@ else
fi
if [ "$UPLOAD_ID" != "" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
./utils/travis/sftp
./utils/travis/sftp wesnoth wesnothd
fi
if (( SECONDS > 60*build_timeout )); then

View file

@ -7,6 +7,7 @@ import os
import datetime
import time
import sys
import hashlib
start = int(time.time())
now = datetime.datetime.now()
@ -45,11 +46,16 @@ with paramiko.Transport(("frs.sourceforge.net", 22)) as transport:
except:
pass
if platform.system() == "Windows" or os.environ["LTS"] == "mingw":
sftp.put("wesnoth.exe", dest+"wesnoth.exe")
sftp.put("wesnothd.exe", dest+"wesnothd.exe")
else:
sftp.put("wesnoth", dest+"wesnoth")
sftp.put("wesnothd", dest+"wesnothd")
for arg in sys.argv[1:]:
sftp.put(arg, dest+arg)
sha256 = hashlib.sha256()
with open(arg, "rb") as f:
while True:
data = f.read(100000)
if not data:
break
sha256.update(data)
print("sha256 of "+arg+": "+sha256.hexdigest())
print("SFTP duration: "+str(int(time.time())-start)+" seconds")

View file

@ -40,15 +40,15 @@ elif [ "$TRAVIS_OS_NAME" = "windows" ]; then
cd $start
export PATH="/c/Python36:"$PATH":/c/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/MSBuild/15.0/Bin/amd64:$start/../external/dll"
if [ "$(which python3)" == "" ] || [ "$(which sqlite3)" == "" ] || [ ! -d "../external" ]; then
echo "Failed to retrieve dependencies!"
exit 1
echo "Failed to retrieve dependencies!"
exit 1
else
echo "Dependencies retrieved and installed!"
echo "Dependencies retrieved and installed!"
fi
./utils/travis/windows-file-hasher.sh "projectfiles/VC14/$OPT/filehashes.sqlite"
else
if [ "$NLS" != "true" ]; then
if [ "$NLS" == "false" ]; then
echo "po/" >> .dockerignore
fi

View file

@ -59,7 +59,8 @@ else
# additional permissions required due to flatpak's use of bubblewrap
docker run --cap-add=ALL --privileged \
--env SFTP_PASSWORD --env LTS --env TRAVIS_COMMIT --env BRANCH --env UPLOAD_ID --env TRAVIS_PULL_REQUEST --env NLS --env CC --env CXX --env TOOL \
--env CXXSTD --env OPT --env WML_TESTS --env WML_TEST_TIME --env PLAY_TEST --env MP_TEST --env BOOST_TEST --env LTO --env SAN --env VALIDATE \
--env CXXSTD --env OPT --env WML_TESTS --env WML_TEST_TIME --env PLAY_TEST --env MP_TEST --env BOOST_TEST --env LTO --env SAN --env VALIDATE \
--env TRAVIS_TAG \
--volume "$HOME"/build-cache:/home/wesnoth-travis/build \
--volume "$HOME"/flatpak-cache:/home/wesnoth-travis/flatpak-cache \
--volume "$HOME"/.ccache:/root/.ccache \