Skip to content

Commit

Permalink
fixed updater not grapping the renamed file names
Browse files Browse the repository at this point in the history
  • Loading branch information
Robosturm committed Jan 26, 2025
1 parent 170dd3a commit 9cb63e8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
installerCommands1: choco install openssl --version=3.3.2 --force -y --install-arguments="'/DIR=C:/openSsl/'"
installerCommands2: ''
source_asset: 'Commander_Wars.zip'
asset_file: 'Commander_Wars-Win10_x64'
asset_name: 'Commander_Wars-Win10_x64-${{github.ref_name}}.zip'
cmakeOptions: '"-DCMAKE_GENERATOR:STRING=MinGW Makefiles" -DOPENSSL_LIB_PATH="C:/openSsl/bin" -DOPENSSL_INCLUDE_DIR="C:/openSsl/include" -DOPENSSL_USE_STATIC_LIBS="ON" -DPRECOMPILEDOPENSSL="ON" "-DCMAKE_C_COMPILER:FILEPATH=D:/a/Commander_Wars/Commander_Wars/qt/Qt/Tools/mingw1310_64/bin/gcc.exe" "-DCMAKE_CXX_COMPILER:FILEPATH=D:/a/Commander_Wars/Commander_Wars/qt/Qt/Tools/mingw1310_64/bin/g++.exe"'
- buildTarget: windows-server
Expand All @@ -57,6 +58,7 @@ jobs:
installerCommands1: choco install openssl --version=3.3.2 --force -y --install-arguments="'/DIR=C:/openSsl/'"
installerCommands2: ''
source_asset: 'Commander_Wars.zip'
asset_file: 'Commander_Wars_Dedicated_Server-Win10_x64'
asset_name: 'Commander_Wars_Dedicated_Server-Win10_x64-${{github.ref_name}}.zip'
cmakeOptions: '"-DCMAKE_GENERATOR:STRING=MinGW Makefiles" -DOPENSSL_LIB_PATH="C:/openSsl/bin" -DOPENSSL_INCLUDE_DIR="C:/openSsl/include" -DOPENSSL_USE_STATIC_LIBS="ON" -DPRECOMPILEDOPENSSL="ON" -DGRAPHICSUPPORT=OFF -DAUDIOSUPPORT=OFF -DUPDATESUPPORT=OFF "-DCMAKE_C_COMPILER:FILEPATH=D:/a/Commander_Wars/Commander_Wars/qt/Qt/Tools/mingw1310_64/bin/gcc.exe" "-DCMAKE_CXX_COMPILER:FILEPATH=D:/a/Commander_Wars/Commander_Wars/qt/Qt/Tools/mingw1310_64/bin/g++.exe"'
- buildTarget: ubuntu-desktop
Expand All @@ -68,6 +70,7 @@ jobs:
installerCommands1: 'sudo apt-get update'
installerCommands2: 'sudo apt-get install libxcb-cursor0 libfuse2 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio'
source_asset: 'Commander_Wars-x86_64.AppImage'
asset_file: 'Commander_Wars-Linux_x64'
asset_name: 'Commander_Wars-Linux_x64-${{github.ref_name}}.AppImage'
cmakeOptions: ' -DOPENSSL_USE_STATIC_LIBS=FALSE'
serverFlag: ''
Expand All @@ -81,6 +84,7 @@ jobs:
installerCommands1: 'sudo apt-get update'
installerCommands2: 'sudo apt-get install libxcb-cursor0 libfuse2 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio'
source_asset: 'Commander_Wars_Dedicated_Server-x86_64.AppImage'
asset_file: 'Commander_Wars_Dedicated_Server-Linux_x64'
asset_name: 'Commander_Wars_Dedicated_Server-Linux_x64-${{github.ref_name}}.AppImage'
cmakeOptions: '-DGRAPHICSUPPORT=OFF -DAUDIOSUPPORT=OFF -DUPDATESUPPORT=OFF -DOPENSSL_USE_STATIC_LIBS=FALSE'
serverFlag: '-server'
Expand All @@ -94,6 +98,7 @@ jobs:
installerCommands1: ''
installerCommands2: ''
source_asset: 'Commander_Wars.zip'
asset_file: 'Commander_Wars-macOS'
asset_name: 'Commander_Wars-macOS-${{github.ref_name}}.zip'
cmakeOptions: '-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl'
- buildTarget: android-armv7
Expand All @@ -109,6 +114,7 @@ jobs:
installerCommands1: 'choco install ninja'
installerCommands2: ''
source_asset: 'android-build/build/outputs/apk/release/android-build-release-signed.apk'
asset_file: 'Commander_Wars-Android_armeabi_v7a'
asset_name: 'Commander_Wars-Android_armeabi_v7a-${{github.ref_name}}.apk'
cmakeOptions: ''
openSslabiPath: 'android_openssl/ssl_3/armeabi-v7a'
Expand All @@ -125,6 +131,7 @@ jobs:
installerCommands1: 'choco install ninja'
installerCommands2: ''
source_asset: 'android-build/build/outputs/apk/release/android-build-release-signed.apk'
asset_file: 'Commander_Wars-Android_arm64_v8a'
asset_name: 'Commander_Wars-Android_arm64_v8a-${{github.ref_name}}.apk'
cmakeOptions: ''
openSslabiPath: 'android_openssl/ssl_3/arm64-v8a'
Expand Down Expand Up @@ -195,6 +202,7 @@ jobs:
-DCOW_BUILD_NAME="${{github.ref_name}}" \
-DCOW_UPDATETARGET="${{matrix.asset_name}}" \
-DCOW_INSTALL_DIR="Commander_Wars_Release" \
-DUPDATE_FILE="${{matrix.asset_file}}" \
${{matrix.cmakeOptions}}
- name: Configure android cmake
Expand Down Expand Up @@ -227,6 +235,7 @@ jobs:
-DCOW_BUILD_TAG="Dummy" \
-DCOW_UPDATETARGET="Dummy" \
-DCOW_INSTALL_DIR="Commander_Wars_Release" \
-DUPDATE_FILE="${{matrix.asset_file}}" \
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install"
- name: Build other
Expand Down Expand Up @@ -280,6 +289,7 @@ jobs:
-DCOW_BUILD_TAG="${{github.ref}}" \
-DCOW_BUILD_NAME="${{github.ref_name}}" \
-DCOW_UPDATETARGET="${{matrix.asset_name}}" \
-DUPDATE_FILE="${{matrix.asset_file}}" \
-DCOW_INSTALL_DIR="Commander_Wars_Release" \
${{matrix.cmakeOptions}}
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ option(DEPLOY_RESOURCES_AS_FOLDER "if files should be compiled into the exe or d
option(UPDATESUPPORT "Enables the automatic updater for the game which updates to the latest github version should be turned off for local builds not supported for android" OFF)
option(DEFAULTAIPIPE "If the system should use a separate process for the ai as default variant. Disable it for system that can't launch the same exe twice e.g. android." ON)
option(PRECOMPILED_HEADERS "Whether to use precompiled headers to speed up compilation. This can make precompiled headers less effective." ON)
set(UPDATE_FILE "Commander_Wars-Win10_x64" CACHE STRING "UPDATE File")
###################################################################################
# show configuration
###################################################################################
Expand Down Expand Up @@ -213,11 +214,12 @@ endif()
###################################################################################
add_definitions(
-DVERSION_MAJOR=0
-DVERSION_MINOR=38
-DVERSION_MINOR=37
-DVERSION_REVISION=0
-DVERSION_SUFFIX="main"
-DCOW_BUILD_TAG="${COW_BUILD_TAG}"
-DCOW_BUILD_NAME="${COW_BUILD_NAME}"
-DUPDATE_FILE="${UPDATE_FILE}"
)

set(COW_ANDROID_VERSION_NAME "0.38.0-main")
Expand Down
2 changes: 1 addition & 1 deletion updater/filedownloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void FileDownloader::onResponseFinished(QNetworkReply* pReply)

void FileDownloader::startDownloading()
{
QString targetFile = m_baseUrl + "download/" + m_latestTag + "/" + m_targetFile;
QString targetFile = m_baseUrl + "download/" + m_latestTag + "/" + m_targetFile + "-" + m_latestTag + ".zip";
GameConsole::print("Starting download of " + targetFile, GameConsole::eINFO);
QUrl targetUrl(targetFile);
downloadFile(targetUrl);
Expand Down
2 changes: 1 addition & 1 deletion updater/gameupdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const char* const GameUpdater::MODE_FORCE = "force";
const char* const GameUpdater::MODE_INSTALL = "install";

GameUpdater::GameUpdater()
: m_filedownloader(QString("Commander_Wars_Win10_x64.zip"), // COW_UPDATETARGET),
: m_filedownloader(QString(UPDATE_FILE), // COW_UPDATETARGET),
UPDATE_URL,
LATEST,
QString(COW_BUILD_TAG),
Expand Down

0 comments on commit 9cb63e8

Please sign in to comment.