retrieve steam SDK from a private repo

develop
Myk Taylor 2023-05-18 14:06:00 -07:00
parent 73f6c66c3e
commit 1212ee0ef8
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
3 changed files with 42 additions and 46 deletions

@ -72,12 +72,6 @@ jobs:
# - name: Download DF # - name: Download DF
# run: | # run: |
# sh ci/download-df.sh # sh ci/download-df.sh
- name: Restore steam SDK
uses: actions/cache@v3
with:
path: depends/steam
key: steam-sdk-156
enableCrossOsArchive: true
- name: Configure DFHack - name: Configure DFHack
env: env:
CC: gcc-${{ matrix.gcc }} CC: gcc-${{ matrix.gcc }}
@ -145,6 +139,13 @@ jobs:
with: with:
submodules: true submodules: true
fetch-depth: 0 fetch-depth: 0
- name: Get 3rd party SDKs
uses: actions/checkout@v3
with:
repository: DFHack/3rdparty
ref: main
token: ${{ secrets.DFHACK_3RDPARTY_TOKEN }}
path: depends
- name: Fetch ccache - name: Fetch ccache
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
@ -155,7 +156,7 @@ jobs:
ccache-win64-cross-msvc ccache-win64-cross-msvc
- name: Cross-compile win64 artifacts - name: Cross-compile win64 artifacts
env: env:
CMAKE_EXTRA_ARGS: '-DBUILD_STONESENSE:BOOL=1' CMAKE_EXTRA_ARGS: '-DBUILD_STONESENSE:BOOL=1 -DBUILD_DFLAUNCH:BOOL=1'
run: | run: |
cd build cd build
bash -x build-win64-from-linux.sh bash -x build-win64-from-linux.sh

@ -32,6 +32,13 @@ jobs:
submodules: true submodules: true
fetch-depth: 0 fetch-depth: 0
ref: ${{ github.event.inputs.commit_hash }} ref: ${{ github.event.inputs.commit_hash }}
- name: Get 3rd party SDKs
uses: actions/checkout@v3
with:
repository: DFHack/3rdparty
ref: main
token: ${{ secrets.DFHACK_3RDPARTY_TOKEN }}
path: depends
- name: Fetch ccache - name: Fetch ccache
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
@ -40,12 +47,6 @@ jobs:
restore-keys: | restore-keys: |
ccache-win64-cross-msvc-${{ github.event.inputs.commit_hash }} ccache-win64-cross-msvc-${{ github.event.inputs.commit_hash }}
ccache-win64-cross-msvc ccache-win64-cross-msvc
- name: Restore steam SDK
uses: actions/cache@v3
with:
path: depends/steam
key: steam-sdk-156
enableCrossOsArchive: true
- name: Cross-compile win64 artifacts - name: Cross-compile win64 artifacts
env: env:
CMAKE_EXTRA_ARGS: '-DBUILD_STONESENSE:BOOL=1 -DBUILD_DFLAUNCH:BOOL=1' CMAKE_EXTRA_ARGS: '-DBUILD_STONESENSE:BOOL=1 -DBUILD_DFLAUNCH:BOOL=1'

@ -1,38 +1,32 @@
project(package_windows) project(package_windows)
if(WIN32) option(BUILD_DFLAUNCH "Whether to build the Steam launcher exectuable (requires Steam SDK)." OFF)
if (BUILD_DFLAUNCH)
if ((DEFINED ENV{steam_username}) AND (DEFINED ENV{steam_password})) if(WIN32 AND BUILD_DFLAUNCH)
# download Steam SDK # builder must manually download Steam SDK
set (STEAMAPI_DIR ${dfhack_SOURCE_DIR}/depends/steam) set (STEAMAPI_DIR ${dfhack_SOURCE_DIR}/depends/steam)
file(DOWNLOAD "https://partner.steamgames.com/downloads/steamworks_sdk_156.zip" set (STEAMAPI_VER 156)
${STEAMAPI_DIR}/steamworks_sdk_156.zip set (STEAMAPI_ZIP_EXPECTED_HASH af5a579990dbe5ae4c1b0689260d001b)
EXPECTED_HASH MD5=af5a579990dbe5ae4c1b0689260d001b set (STEAMSDK_ZIP ${STEAMAPI_DIR}/steamworks_sdk_${STEAMAPI_VER}.zip)
USERPWD $ENV{steam_username}:$ENV{steam_password}
STATUS STEAM_SDK_DOWNLOAD_STATUS set (STEAM_SDK_HASH "NOT FOUND")
SHOW_PROGRESS file(MD5 ${STEAMSDK_ZIP} STEAM_SDK_HASH)
) if (NOT (${STEAM_SDK_HASH} STREQUAL ${STEAMAPI_ZIP_EXPECTED_HASH}))
list(GET STEAM_SDK_DOWNLOAD_STATUS 0 STEAM_SDK_DL_STATUS_CODE) message(FATAL_ERROR "You need the Steamworks SDK at ${STEAMSDK_ZIP} to build launchdf.exe. Please disable the BUILD_DFLAUNCH CMake option or download the Steam SDK from: https://partner.steamgames.com/downloads/steamworks_sdk_${STEAMAPI_VER}.zip")
list(GET STEAM_SDK_DOWNLOAD_STATUS 1 STEAM_SDK_DL_ERROR_MESSAGE) endif()
if (NOT (${STEAM_SDK_DL_STATUS_CODE} EQUAL 0)) if (${STEAMSDK_ZIP} IS_NEWER_THAN ${STEAMAPI_DIR}/sdk)
message(FATAL_ERROR "Steam SDK download: " ${STEAM_SDK_DL_ERROR_MESSAGE})
else ()
message(STATUS "Steam SDK download: " ${STEAM_SDK_DL_ERROR_MESSAGE})
file(ARCHIVE_EXTRACT file(ARCHIVE_EXTRACT
INPUT ${STEAMAPI_DIR}/steamworks_sdk_156.zip INPUT ${STEAMSDK_ZIP}
DESTINATION ${STEAMAPI_DIR}) DESTINATION ${STEAMAPI_DIR})
endif()
set(STEAMAPI_LIBRARY "${STEAMAPI_DIR}/sdk/redistributable_bin/win64/steam_api64.lib") set(STEAMAPI_LIBRARY "${STEAMAPI_DIR}/sdk/redistributable_bin/win64/steam_api64.lib")
set(STEAMAPI_SOURCE_DIR "${STEAMAPI_DIR}/sdk/public/steam") set(STEAMAPI_SOURCE_DIR "${STEAMAPI_DIR}/sdk/public/steam")
set(STEAMAPI_SHARED_LIBRARY "${STEAMAPI_DIR}/sdk/redistributable_bin/win64/steam_api64.dll") set(STEAMAPI_SHARED_LIBRARY "${STEAMAPI_DIR}/sdk/redistributable_bin/win64/steam_api64.dll")
endif()
else()
message(SEND_ERROR "Need to set steam_username and steam_password in environment to download Steamworks SDK")
endif()
include_directories(${STEAMAPI_SOURCE_DIR}) include_directories(${STEAMAPI_SOURCE_DIR})
link_libraries(${STEAMAPI_LIBRARY}) link_libraries(${STEAMAPI_LIBRARY})
add_executable(launchdf WIN32 launchdf.cpp) add_executable(launchdf WIN32 launchdf.cpp)
install(TARGETS launchdf DESTINATION ${DFHACK_DATA_DESTINATION}) install(TARGETS launchdf DESTINATION ${DFHACK_DATA_DESTINATION})
install(FILES ${STEAMAPI_SHARED_LIBRARY} DESTINATION ${DFHACK_DATA_DESTINATION}) install(FILES ${STEAMAPI_SHARED_LIBRARY} DESTINATION ${DFHACK_DATA_DESTINATION})
endif()
endif() endif()