Skip to content

Commit

Permalink
split CMakeLists a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Velaron committed Mar 22, 2024
1 parent cc0e343 commit a395896
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 27 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,14 @@ jobs:
steps:
- name: Fetch artifacts
uses: actions/download-artifact@v4
- name: Remove old release
uses: ClementTsang/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: continuous
delete_release: true
repo: ${{ env.GITHUB_REPOSITORY }}
- name: Prepare release
run: |
gh release delete continuous --cleanup-tag
mv Android/app-debug-signed.apk CS16Client-Android.apk
mv */*.zip .
mv */*.tar.gz .
sleep 60s
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Purge artifacts
uses: geekyeggo/delete-artifact@v2
with:
Expand Down
17 changes: 1 addition & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,7 @@ if(BUILD_MAINUI)
add_subdirectory(3rdparty/mainui_cpp)
endif()

# ugly and not performant but cmake is what it is
if(NOT ANDROID)
add_custom_command(OUTPUT ${EXTRAS_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory "${EXTRAS_DIR}")

add_custom_target(pack_extras ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/cs16client-extras" "${EXTRAS_DIR}"
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/yapb/cfg/addons" "${EXTRAS_DIR}"
COMMAND ${CMAKE_COMMAND} -E tar cf "${EXTRAS_DIR}.pk3" --format=zip .
WORKING_DIRECTORY "${EXTRAS_DIR}"
DEPENDS "${EXTRAS_DIR}")

install(FILES "${CMAKE_CURRENT_BINARY_DIR}/extras.pk3" DESTINATION "${GAME_DIR}/")
endif()
include(GenerateExtras)

if(WIN32)
set(CPACK_GENERATOR "ZIP")
Expand Down
16 changes: 16 additions & 0 deletions cmake/GenerateExtras.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# ugly and not performant but cmake is what it is
if(NOT ANDROID)
add_custom_command(OUTPUT ${EXTRAS_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory "${EXTRAS_DIR}")

add_custom_target(pack_extras ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/cs16client-extras" "${EXTRAS_DIR}"
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/yapb/cfg/addons" "${EXTRAS_DIR}"
COMMAND ${CMAKE_COMMAND} -E tar cf "${EXTRAS_DIR}.pk3" --format=zip .
WORKING_DIRECTORY "${EXTRAS_DIR}"
DEPENDS "${EXTRAS_DIR}")

install(FILES "${CMAKE_CURRENT_BINARY_DIR}/extras.pk3" DESTINATION "${GAME_DIR}/")
endif()

0 comments on commit a395896

Please sign in to comment.