From 3159677ba015fec74ad558dddcb0c596a4401dca Mon Sep 17 00:00:00 2001 From: Qiuzhizhe <42761326+quizhizhe@users.noreply.github.com> Date: Wed, 22 Mar 2023 06:11:02 -0700 Subject: [PATCH] Fix AuToTooth --- .github/workflows/publish_release.yml | 5 ++++- Scripts/UploadTooth.sh | 12 ++++++------ Tools/SymDBHelper/CMakeLists.txt | 11 +++++++++-- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index 1f38d0e..f7cf0a4 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -236,9 +236,12 @@ jobs: if: github.event.inputs.status == 'stable' run: | cd Scripts + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + chmod +x ./UploadTooth.sh ./UploadTooth.sh ${{ github.event.inputs.tag }} env: - REPO_KEY: ${{secrets.ACTIONS_TOKEN}} + REPO_KEY: ${{secrets.PUSH_TOKEN}} USERNAME: github-actions[bot] shell: bash diff --git a/Scripts/UploadTooth.sh b/Scripts/UploadTooth.sh index b1fb68f..87b6300 100644 --- a/Scripts/UploadTooth.sh +++ b/Scripts/UploadTooth.sh @@ -4,9 +4,10 @@ TOOTH_REMOTE_PATH=https://github.com/Tooth-Hub/LiteLoaderBDS-Legacy.git cd .. echo [INFO] Fetching LiteLoaderBDS-Legacy Tooth to GitHub ... - +git config --global core.autocrlf false # 获取标签 -now_tag=$(git describe --tags --always | cut -d "-" -f 1) +#now_tag=$(git describe --tags --always | cut -d "-" -f 1) +now_tag=$1 echo NOW_TAG $now_tag @@ -29,8 +30,7 @@ echo cp -r build/LiteLoaderBDS/* Tooth cd Tooth -version=$1 -vers=" \"version\": \"${version:1}\"," +vers=" \"version\": \"${now_tag:1}\"," #modify tooth.json sed -i "4c\ ${vers}" ./tooth.json @@ -48,8 +48,8 @@ if [ "$now_status" ]; then echo [INFO] Pushing to origin... echo - git push https://%USERNAME%:%REPO_KEY%@github.com/Tooth-Hub/LiteLoaderBDS-Legacy.git Protocol-408 - git push --tags https://%USERNAME%:%REPO_KEY%@github.com/Tooth-Hub/LiteLoaderBDS-Legacy.git Protocol-408 + git push https://${USERNAME}:${REPO_KEY}@github.com/Tooth-Hub/LiteLoaderBDS-Legacy.git Protocol-408 + git push --tags https://${USERNAME}:${REPO_KEY}@github.com/Tooth-Hub/LiteLoaderBDS-Legacy.git Protocol-408 cd .. echo diff --git a/Tools/SymDBHelper/CMakeLists.txt b/Tools/SymDBHelper/CMakeLists.txt index 952efb2..6ef4fb0 100644 --- a/Tools/SymDBHelper/CMakeLists.txt +++ b/Tools/SymDBHelper/CMakeLists.txt @@ -3,7 +3,6 @@ project(SymDBHelper) set(CMAKE_CXX_STANDARD 17) set(CMAKE_BUILD_TYPE Release) -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/LiteLoader/Lib/) add_definitions(-D"NDEBUG" -D"_LIB" -D"_UNICODE" -D"UNICODE") @@ -13,4 +12,12 @@ add_compile_options( ) add_library(SymDBHelper STATIC SymDBHelper.cpp) -target_link_libraries(SymDBHelper Demangler) \ No newline at end of file +target_link_libraries(SymDBHelper Demangler) + +# use hardcode path to avoid the problem of different build path +add_custom_command( + TARGET SymDBHelper POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_BINARY_DIR}/sdk/lib/ + COMMENT "Copying lib to sdk directory" + VERBATIM +) \ No newline at end of file