-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal: build gamemode instead of downloading prebuilt (#1732)
- Loading branch information
Showing
3 changed files
with
70 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
include(${CMAKE_SOURCE_DIR}/cmake/yarn.cmake) | ||
|
||
message(STATUS "Downloading gamemode sources") | ||
|
||
file(DOWNLOAD ${GAMEMODE_ZIP_URL} ${GAMEMODE_ZIP_DEST} | ||
STATUS status | ||
LOG log | ||
TLS_VERIFY ON | ||
HTTPHEADER "Authorization: token ${GITHUB_TOKEN}" | ||
) | ||
list(GET status 0 status_code) | ||
list(GET status 1 status_string) | ||
if(NOT status_code EQUAL 0) | ||
message(FATAL_ERROR "error: downloading gamemode sources failed: ${status_string}") | ||
endif() | ||
|
||
message(STATUS "Downloaded gamemode sources") | ||
|
||
message(STATUS "Extracting gamemode sources") | ||
|
||
# Execute the CMake command to extract the zip file | ||
execute_process( | ||
COMMAND ${CMAKE_COMMAND} -E tar xvf ${GAMEMODE_ZIP_DEST} | ||
RESULT_VARIABLE TAR_RESULT | ||
OUTPUT_QUIET # stop telling gamemode filenames in console | ||
) | ||
|
||
if(NOT TAR_RESULT EQUAL "0") | ||
message(FATAL_ERROR "Failed to extract gamemode zip file") | ||
endif() | ||
|
||
message(STATUS "Extracted gamemode sources") | ||
|
||
message(STATUS "Installing yarn dependencies for gamemode") | ||
|
||
yarn_execute_command( | ||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/skymp5-functions-lib/${GAMEMODE_REPO_NAME}-${GAMEMODE_BRANCH} | ||
COMMAND install | ||
) | ||
|
||
message(STATUS "Installed yarn dependencies for gamemode") | ||
|
||
message(STATUS "Building gamemode.js") | ||
|
||
yarn_execute_command( | ||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/skymp5-functions-lib/${GAMEMODE_REPO_NAME}-${GAMEMODE_BRANCH} | ||
COMMAND build | ||
) | ||
|
||
message(STATUS "Built gamemode.js") | ||
|
||
message(STATUS "Installing gamemode.js") | ||
|
||
file(COPY ${CMAKE_BINARY_DIR}/skymp5-functions-lib/${GAMEMODE_REPO_NAME}-${GAMEMODE_BRANCH}/build/gamemode.js DESTINATION "${GAMEMODE_JS_DEST_DIR}") | ||
|
||
message(STATUS "Installed gamemode.js") |
This file was deleted.
Oops, something went wrong.