From 52d8e5a2c2f7dcac61ad5ee4be4540d9b08f0276 Mon Sep 17 00:00:00 2001 From: c6 <31777460+c6-dev@users.noreply.github.com> Date: Wed, 15 Jan 2025 14:48:35 +0400 Subject: [PATCH 01/12] add casino functions, MLC override functions --- JG/JohnnyGuitarNVSE.cpp | 11 ++++-- JG/JohnnyGuitarNVSE.h | 16 +++++++- JG/functions/fn_gameplay.h | 80 ++++++++++++++++++++++++++++++++++++++ nvse/nvse/GameForms.h | 8 ++++ nvse/nvse/GameObjects.h | 2 +- nvse/nvse/ParamInfos.h | 11 ++++++ 6 files changed, 123 insertions(+), 5 deletions(-) diff --git a/JG/JohnnyGuitarNVSE.cpp b/JG/JohnnyGuitarNVSE.cpp index 3fc20cc..ad1e1f1 100644 --- a/JG/JohnnyGuitarNVSE.cpp +++ b/JG/JohnnyGuitarNVSE.cpp @@ -49,7 +49,7 @@ HMODULE JohnnyHandle; _CaptureLambdaVars CaptureLambdaVars; _UncaptureLambdaVars UncaptureLambdaVars; NiTMap** g_gameFormEditorIDsMap = reinterpret_cast**>(0x11C54C8); -#define JG_VERSION 514 +#define JG_VERSION 515 void MessageHandler(NVSEMessagingInterface::Message* msg) { switch (msg->type) { case NVSEMessagingInterface::kMessage_NewGame: @@ -75,6 +75,8 @@ void MessageHandler(NVSEMessagingInterface::Message* msg) { hk_BarterHook::barterFilterListRight.clear(); NPCAccuracy::FlushMapRefs(); shakeRequests.clear(); + mlcOverridden = false; + mlcOverride = nullptr; break; } case NVSEMessagingInterface::kMessage_PostLoadGame: @@ -496,8 +498,11 @@ extern "C" { REG_CMD(RemoveNoteQuest); REG_CMD(SetHUDShudderPower); REG_CMD(GetHUDShudderPower); - REG_CMD(SetDialogResponseOverrideValues); // Function is subject to overrides at random and therefore not eligible for documentation. Can be removed at any time, so mod breakage due to using it will not be considered. - + REG_CMD(SetDialogResponseOverrideValues); // do not document + REG_CMD(SetMediaLocationControllerOverride); // do not document + REG_CMD(ClearMediaLocationControllerOverride); // do not document + REG_CMD(GetCasinoWinnings); + REG_CMD(SetCasinoWinnings); g_scriptInterface = (NVSEScriptInterface*)nvse->QueryInterface(kInterface_Script); g_cmdTableInterface = (NVSECommandTableInterface*)nvse->QueryInterface(kInterface_CommandTable); s_strArgBuf = (char*)malloc((sizeof(char)) * 1024); diff --git a/JG/JohnnyGuitarNVSE.h b/JG/JohnnyGuitarNVSE.h index 88bb94e..d85a38c 100644 --- a/JG/JohnnyGuitarNVSE.h +++ b/JG/JohnnyGuitarNVSE.h @@ -68,7 +68,8 @@ Setting** g_miscStatData = (Setting**)0x11C6D50; char g_workingDir[MAX_PATH]; std::unordered_set jg_gameRadioSet; static float g_viewmodel_near = 0.f; - +bool mlcOverridden = false; +MediaLocationController* mlcOverride = nullptr; extern "C" { bool __cdecl JGSetViewmodelClipDistance(float value); float __cdecl JGGetViewmodelClipDistance(); @@ -1795,6 +1796,17 @@ __declspec (noinline) void HandleDLLInterop() { } } + +MediaLocationController* __fastcall MLCOverrideHook(PlayerCharacter* player) +{ + if (mlcOverridden) + { + return mlcOverride; + } + return ThisStdCall(0x9698A0, player); + +} + float getHUDShakePower() { if (shakeRequests.empty()) { return 0.0f; @@ -1863,6 +1875,8 @@ void HandleFunctionPatches() { WriteRelCall(0x8752F2, UInt32(SetViewmodelFrustumHook)); + WriteRelCall(0x82FC95, (UInt32)MLCOverrideHook); + } float timer22 = 30.0; void HandleGameHooks() { diff --git a/JG/functions/fn_gameplay.h b/JG/functions/fn_gameplay.h index 303c1c2..e0b086a 100644 --- a/JG/functions/fn_gameplay.h +++ b/JG/functions/fn_gameplay.h @@ -1,4 +1,5 @@ #pragma once +#include "ParamInfos.h" // Functions affecting gameplay DEFINE_COMMAND_PLUGIN(ToggleLevelUpMenu, , 0, 1, kParams_OneInt); DEFINE_COMMAND_PLUGIN(TogglePipBoy, , 0, 1, kParams_OneOptionalInt); @@ -58,6 +59,11 @@ DEFINE_COMMAND_PLUGIN(ClearCustomMapMarker, , 0, 0, NULL); DEFINE_COMMAND_PLUGIN(EjectCasing, , 0, 2, kParams_EjectCasing); DEFINE_COMMAND_PLUGIN(SetHUDShudderPower, , 0, 1, kParams_OneFloat); DEFINE_COMMAND_PLUGIN(GetHUDShudderPower, , 0, 0, NULL); +DEFINE_COMMAND_ALT_PLUGIN(SetMediaLocationControllerOverride, SetMLCOverride, , 0, 1, kParams_OneForm); +DEFINE_COMMAND_ALT_PLUGIN(ClearMediaLocationControllerOverride, ClearMLCOverride, , 0, 0, NULL); +DEFINE_COMMAND_ALT_PLUGIN(GetCasinoWinnings, , , 0, 1, kParams_OneCasino); +DEFINE_COMMAND_ALT_PLUGIN(SetCasinoWinnings, , , 0, 2, kParams_OneCasinoOneInt); + void(__cdecl* HandleActorValueChange)(ActorValueOwner* avOwner, int avCode, float oldVal, float newVal, ActorValueOwner* avOwner2) = (void(__cdecl*)(ActorValueOwner*, int, float, float, ActorValueOwner*))0x66EE50; bool(*Cmd_HighLightBodyPart)(COMMAND_ARGS) = (bool (*)(COMMAND_ARGS)) 0x5BB570; @@ -67,6 +73,80 @@ void(__cdecl* HUDMainMenu_UpdateVisibilityState)(signed int) = (void(__cdecl*)(s std::unordered_map> tempEffectMap; +bool __cdecl Cmd_SetCasinoWinnings_Execute(COMMAND_ARGS) +{ + TESCasino* casino; + SInt32 earnings; + if (ExtractArgs(EXTRACT_ARGS, &casino, &earnings) && casino) + { + auto casinoRefId = casino->refID; + auto iter = PlayerCharacter::GetSingleton()->casinoDataList->Head(); + do + { + if (auto casinoData = iter->data) + { + if (casinoData->casinoRefID == casinoRefId) + { + casinoData->earnings = earnings; + return true; + } + } + } while (iter = iter->next); + + auto casinoStats = (CasinoStats*)GameHeapAlloc(sizeof(CasinoStats)); + casinoStats->earningStage = 0; + casinoStats->earnings = earnings; + casinoStats->casinoRefID = casinoRefId; + PlayerCharacter::GetSingleton()->casinoDataList->Insert(casinoStats); + } + + return true; +} + +bool __cdecl Cmd_GetCasinoWinnings_Execute(COMMAND_ARGS) +{ + *result = 0; + TESCasino* casino = nullptr; + if (ExtractArgs(EXTRACT_ARGS, &casino) && casino) + { + auto casinoRefId = casino->refID; + auto iter = PlayerCharacter::GetSingleton()->casinoDataList->Head(); + do + { + if (auto casinoData = iter->data) + { + if (casinoData->casinoRefID == casinoRefId) + { + *result = casinoData->earnings; + break; + } + } + } while (iter = iter->next); + } + + return true; +} + +bool Cmd_ClearMediaLocationControllerOverride_Execute(COMMAND_ARGS) { + *result = 0; + mlcOverridden = false; + mlcOverride = nullptr; + *result = 1; + + return true; +} + +bool Cmd_SetMediaLocationControllerOverride_Execute(COMMAND_ARGS) { + *result = 0; + MediaLocationController* ctrl = NULL; + if (ExtractArgsEx(EXTRACT_ARGS_EX, &ctrl) && IS_TYPE(ctrl, MediaLocationController)) { + mlcOverridden = true; + mlcOverride = ctrl; + *result = 1; + } + return true; +} + bool Cmd_GetHUDShudderPower_Execute(COMMAND_ARGS) { *result = 0; UInt8 modId = scriptObj->GetModIndex(); diff --git a/nvse/nvse/GameForms.h b/nvse/nvse/GameForms.h index ce9b37f..54aebbf 100644 --- a/nvse/nvse/GameForms.h +++ b/nvse/nvse/GameForms.h @@ -5990,3 +5990,11 @@ enum EWhichListForm { eWhichListForm_FormList, eWhichListForm_Max, }; + +struct CasinoStats +{ + UInt32 casinoRefID; + SInt32 earnings; + UInt16 earningStage; + UInt8 gap0A[2]; +}; \ No newline at end of file diff --git a/nvse/nvse/GameObjects.h b/nvse/nvse/GameObjects.h index 2c58724..a7074f5 100644 --- a/nvse/nvse/GameObjects.h +++ b/nvse/nvse/GameObjects.h @@ -811,7 +811,7 @@ class PlayerCharacter : public Character { TESObjectREFR* lastExteriorDoor; // 604 void* unk608; // 608 void* unk60C; // 60C - void* unk610; // 610 + tList* casinoDataList; // 610 tList* caravanCards1; // 614 tList* caravanCards2; // 618 UInt32 unk61C[7]; // 61C diff --git a/nvse/nvse/ParamInfos.h b/nvse/nvse/ParamInfos.h index a4444c8..c4406c1 100644 --- a/nvse/nvse/ParamInfos.h +++ b/nvse/nvse/ParamInfos.h @@ -831,4 +831,15 @@ static ParamInfo kParams_EjectCasing[2] = { { "Target Node", kParamType_String, 1 }, { "Custom Casing Path", kParamType_String, 1 }, +}; + +static ParamInfo kParams_OneCasino[1] = +{ + { "Casino", kParamType_Casino, 1 }, +}; + +static ParamInfo kParams_OneCasinoOneInt[2] = +{ + { "Casino", kParamType_Casino, 1 }, + { "Earnings", kParamType_Integer, 1 }, }; \ No newline at end of file From cd8b532b38e53948bd76f8697451da38b063d90b Mon Sep 17 00:00:00 2001 From: c6 <31777460+c6-dev@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:01:16 +0400 Subject: [PATCH 02/12] add null checks --- JG/functions/fn_gameplay.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/JG/functions/fn_gameplay.h b/JG/functions/fn_gameplay.h index e0b086a..d074af7 100644 --- a/JG/functions/fn_gameplay.h +++ b/JG/functions/fn_gameplay.h @@ -79,19 +79,22 @@ bool __cdecl Cmd_SetCasinoWinnings_Execute(COMMAND_ARGS) SInt32 earnings; if (ExtractArgs(EXTRACT_ARGS, &casino, &earnings) && casino) { + auto casinoRefId = casino->refID; auto iter = PlayerCharacter::GetSingleton()->casinoDataList->Head(); - do - { - if (auto casinoData = iter->data) + if (iter) { + do { - if (casinoData->casinoRefID == casinoRefId) + if (auto casinoData = iter->data) { - casinoData->earnings = earnings; - return true; + if (casinoData->casinoRefID == casinoRefId) + { + casinoData->earnings = earnings; + return true; + } } - } - } while (iter = iter->next); + } while (iter = iter->next); + } auto casinoStats = (CasinoStats*)GameHeapAlloc(sizeof(CasinoStats)); casinoStats->earningStage = 0; @@ -111,6 +114,7 @@ bool __cdecl Cmd_GetCasinoWinnings_Execute(COMMAND_ARGS) { auto casinoRefId = casino->refID; auto iter = PlayerCharacter::GetSingleton()->casinoDataList->Head(); + if (!iter) return true; do { if (auto casinoData = iter->data) From f444b17fadc643721d354a860568e06f3a8e3357 Mon Sep 17 00:00:00 2001 From: c6 <31777460+c6-dev@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:10:44 +0400 Subject: [PATCH 03/12] add gha --- .github/workflows/msbuild.yml | 51 +++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/msbuild.yml diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml new file mode 100644 index 0000000..e7c762a --- /dev/null +++ b/.github/workflows/msbuild.yml @@ -0,0 +1,51 @@ +name: MSBuild + +on: + push: + branches: [ "dev" ] + pull_request: + branches: [ "dev" ] + +env: + SOLUTION_FILE_PATH: JG/johnnyguitar.sln + +permissions: + contents: read + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Add MSBuild to PATH + uses: microsoft/setup-msbuild@v2 + + - name: Build Release + working-directory: ${{env.GITHUB_WORKSPACE}} + run: msbuild /m /p:Configuration=Release ${{env.SOLUTION_FILE_PATH}} /p:PostBuildEventUseInBuild=false + + - name: Build Debug + working-directory: ${{env.GITHUB_WORKSPACE}} + run: msbuild /m /p:Configuration=Debug ${{env.SOLUTION_FILE_PATH}} /p:PostBuildEventUseInBuild=false + + - name: Generate Timestamp + run: | + timestamp=$(date +"%Y%m%d%H%M%S") + echo "artifact_timestamp=$timestamp" >> $GITHUB_ENV + shell: bash + + - name: Publish Release + uses: actions/upload-artifact@v4 + with: + name: JohnnyGuitarNVSE-Release-${{ env.artifact_timestamp }} + path: | + Release\johnnyguitar.dll + + - name: Publish Debug + uses: actions/upload-artifact@v4 + with: + name: JohnnyGuitarNVSE-Debug-${{ env.artifact_timestamp }} + path: | + Debug\johnnyguitar.dll \ No newline at end of file From c6b7723ec99405fff370757983c0449678f833cf Mon Sep 17 00:00:00 2001 From: c6 <31777460+c6-dev@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:15:12 +0400 Subject: [PATCH 04/12] fix missing return --- JG/JohnnyGuitarNVSE.h | 1 + 1 file changed, 1 insertion(+) diff --git a/JG/JohnnyGuitarNVSE.h b/JG/JohnnyGuitarNVSE.h index d85a38c..ee76dc8 100644 --- a/JG/JohnnyGuitarNVSE.h +++ b/JG/JohnnyGuitarNVSE.h @@ -586,6 +586,7 @@ namespace hk_DialogueTopicResponseManageHook { } } PrintLog("End Dialogue Dump"); + return NULL; } From 56e274c9d93c77b1a899ed89663b94153105a8b7 Mon Sep 17 00:00:00 2001 From: c6 <31777460+c6-dev@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:18:08 +0400 Subject: [PATCH 05/12] add continuous release --- .github/workflows/msbuild.yml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index e7c762a..004cc8f 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -48,4 +48,33 @@ jobs: with: name: JohnnyGuitarNVSE-Debug-${{ env.artifact_timestamp }} path: | - Debug\johnnyguitar.dll \ No newline at end of file + Debug\johnnyguitar.dll + + - name: Create or Update Release + id: create_release + uses: actions/create-release@v1 + with: + tag_name: continuous-${{ env.artifact_timestamp }} + release_name: "Continuous release" + draft: false + prerelease: true + body: | + Continuous build generated from the latest push to development branch. + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload Release Artifact (Release) + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: Release/johnnyguitar.dll + asset_name: johnnyguitar-Release-${{ env.artifact_timestamp }}.dll + asset_content_type: application/octet-stream + + - name: Upload Release Artifact (Debug) + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: Debug/johnnyguitar.dll + asset_name: johnnyguitar-Debug-${{ env.artifact_timestamp }}.dll + asset_content_type: application/octet-stream From c47466436958685b805a552b98382aad0b9172e2 Mon Sep 17 00:00:00 2001 From: c6 <31777460+c6-dev@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:25:23 +0400 Subject: [PATCH 06/12] Update msbuild.yml --- .github/workflows/msbuild.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 004cc8f..05d4113 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -9,8 +9,7 @@ on: env: SOLUTION_FILE_PATH: JG/johnnyguitar.sln -permissions: - contents: read +permissions: write-all jobs: build: @@ -41,14 +40,14 @@ jobs: with: name: JohnnyGuitarNVSE-Release-${{ env.artifact_timestamp }} path: | - Release\johnnyguitar.dll + JG\Release\johnnyguitar.dll - name: Publish Debug uses: actions/upload-artifact@v4 with: name: JohnnyGuitarNVSE-Debug-${{ env.artifact_timestamp }} path: | - Debug\johnnyguitar.dll + JG\Debug\johnnyguitar.dll - name: Create or Update Release id: create_release @@ -67,7 +66,7 @@ jobs: uses: actions/upload-release-asset@v1 with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: Release/johnnyguitar.dll + asset_path: JG/Release/johnnyguitar.dll asset_name: johnnyguitar-Release-${{ env.artifact_timestamp }}.dll asset_content_type: application/octet-stream @@ -75,6 +74,6 @@ jobs: uses: actions/upload-release-asset@v1 with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: Debug/johnnyguitar.dll + asset_path: JG/Debug/johnnyguitar.dll asset_name: johnnyguitar-Debug-${{ env.artifact_timestamp }}.dll asset_content_type: application/octet-stream From 17e77ac64bb4a24595ae172ef35631e288ee4b2d Mon Sep 17 00:00:00 2001 From: c6 <31777460+c6-dev@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:36:00 +0400 Subject: [PATCH 07/12] Update msbuild.yml --- .github/workflows/msbuild.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 05d4113..6565287 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -58,22 +58,26 @@ jobs: draft: false prerelease: true body: | - Continuous build generated from the latest push to development branch. + Continuous release generated from the latest push to development branch. env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload Release Artifact (Release) uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: JG/Release/johnnyguitar.dll - asset_name: johnnyguitar-Release-${{ env.artifact_timestamp }}.dll - asset_content_type: application/octet-stream + asset_name: johnnyguitar-Release-${{ env.artifact_timestamp }} + asset_content_type: application/zip - name: Upload Release Artifact (Debug) uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: JG/Debug/johnnyguitar.dll - asset_name: johnnyguitar-Debug-${{ env.artifact_timestamp }}.dll - asset_content_type: application/octet-stream + asset_name: JohnnyGuitarNVSE-Debug-${{ env.artifact_timestamp }} + asset_content_type: application/zip From c898d03c4e6b36fe0c550373f7381b2e92be3e48 Mon Sep 17 00:00:00 2001 From: c6 <31777460+c6-dev@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:43:31 +0400 Subject: [PATCH 08/12] Update msbuild.yml --- .github/workflows/msbuild.yml | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 6565287..f7108a7 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -35,25 +35,23 @@ jobs: echo "artifact_timestamp=$timestamp" >> $GITHUB_ENV shell: bash - - name: Publish Release - uses: actions/upload-artifact@v4 - with: - name: JohnnyGuitarNVSE-Release-${{ env.artifact_timestamp }} - path: | - JG\Release\johnnyguitar.dll + - name: Package Artifacts + run: | + mkdir -p artifacts + zip -j artifacts/JohnnyGuitarNVSE-Release-${{ env.artifact_timestamp }}.zip JG/Release/johnnyguitar.dll + zip -j artifacts/JohnnyGuitarNVSE-Debug-${{ env.artifact_timestamp }}.zip JG/Debug/johnnyguitar.dll - - name: Publish Debug + - name: Publish Zipped Artifacts uses: actions/upload-artifact@v4 with: - name: JohnnyGuitarNVSE-Debug-${{ env.artifact_timestamp }} - path: | - JG\Debug\johnnyguitar.dll + name: Zipped-Artifacts-${{ env.artifact_timestamp }} + path: artifacts/ - name: Create or Update Release id: create_release uses: actions/create-release@v1 with: - tag_name: continuous-${{ env.artifact_timestamp }} + tag_name: continuous release_name: "Continuous release" draft: false prerelease: true @@ -62,22 +60,22 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload Release Artifact (Release) + - name: Upload Artifact (Release) uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: JG/Release/johnnyguitar.dll - asset_name: johnnyguitar-Release-${{ env.artifact_timestamp }} + asset_path: artifacts/JohnnyGuitarNVSE-Release-${{ env.artifact_timestamp }}.zip + asset_name: JohnnyGuitarNVSE-Release-${{ env.artifact_timestamp }}.zip asset_content_type: application/zip - - name: Upload Release Artifact (Debug) + - name: Upload Artifact (Debug) uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: JG/Debug/johnnyguitar.dll - asset_name: JohnnyGuitarNVSE-Debug-${{ env.artifact_timestamp }} + asset_path: artifacts/JohnnyGuitarNVSE-Debug-${{ env.artifact_timestamp }}.zip + asset_name: JohnnyGuitarNVSE-Debug-${{ env.artifact_timestamp }}.zip asset_content_type: application/zip From 76d19e6e4118d37439cf8d9a6ec80616b730d593 Mon Sep 17 00:00:00 2001 From: c6 <31777460+c6-dev@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:48:07 +0400 Subject: [PATCH 09/12] Update msbuild.yml --- .github/workflows/msbuild.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index f7108a7..6401e5c 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -38,8 +38,9 @@ jobs: - name: Package Artifacts run: | mkdir -p artifacts - zip -j artifacts/JohnnyGuitarNVSE-Release-${{ env.artifact_timestamp }}.zip JG/Release/johnnyguitar.dll - zip -j artifacts/JohnnyGuitarNVSE-Debug-${{ env.artifact_timestamp }}.zip JG/Debug/johnnyguitar.dll + Compress-Archive -Path JG\Release\johnnyguitar.dll -DestinationPath artifacts\JohnnyGuitarNVSE-Release-${{ env.artifact_timestamp }}.zip + Compress-Archive -Path JG\Debug\johnnyguitar.dll -DestinationPath artifacts\JohnnyGuitarNVSE-Debug-${{ env.artifact_timestamp }}.zip + shell: pwsh - name: Publish Zipped Artifacts uses: actions/upload-artifact@v4 From 697ca2feb471115021b76a7b26fd9c38ef5ce8d6 Mon Sep 17 00:00:00 2001 From: c6 <31777460+c6-dev@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:54:13 +0400 Subject: [PATCH 10/12] Update msbuild.yml --- .github/workflows/msbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 6401e5c..eb4e442 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -4,7 +4,7 @@ on: push: branches: [ "dev" ] pull_request: - branches: [ "dev" ] + branches: [ "dev" ] env: SOLUTION_FILE_PATH: JG/johnnyguitar.sln From 4ee20feac72b0e7552e0f575e34e87857b907c27 Mon Sep 17 00:00:00 2001 From: c6 <31777460+c6-dev@users.noreply.github.com> Date: Wed, 15 Jan 2025 16:11:28 +0400 Subject: [PATCH 11/12] Update msbuild.yml --- .github/workflows/msbuild.yml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index eb4e442..5602462 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -48,19 +48,34 @@ jobs: name: Zipped-Artifacts-${{ env.artifact_timestamp }} path: artifacts/ - - name: Create or Update Release + - name: Get Release + id: get_release + uses: cardinalby/git-get-release-action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag: 'continuous' + doNotFailIfNotFound: true + - name: Delete old release if exists + if: steps.get_release.outputs.id != '' + uses: dev-drprasad/delete-tag-and-release@v1.0 + with: + tag_name: continuous + github_token: ${{ secrets.GITHUB_TOKEN }} + delete_release: true + - name: Create Release id: create_release uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: continuous release_name: "Continuous release" draft: false - prerelease: true + prerelease: true body: | Continuous release generated from the latest push to development branch. - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + Last updated: ${{ env.artifact_timestamp }} - name: Upload Artifact (Release) uses: actions/upload-release-asset@v1 env: @@ -70,7 +85,6 @@ jobs: asset_path: artifacts/JohnnyGuitarNVSE-Release-${{ env.artifact_timestamp }}.zip asset_name: JohnnyGuitarNVSE-Release-${{ env.artifact_timestamp }}.zip asset_content_type: application/zip - - name: Upload Artifact (Debug) uses: actions/upload-release-asset@v1 env: From 0697c8ea8347bb412896cdb4a389d61a6a5e2402 Mon Sep 17 00:00:00 2001 From: c6 <31777460+c6-dev@users.noreply.github.com> Date: Wed, 15 Jan 2025 16:15:56 +0400 Subject: [PATCH 12/12] Update msbuild.yml --- .github/workflows/msbuild.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 5602462..d207c84 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -3,8 +3,6 @@ name: MSBuild on: push: branches: [ "dev" ] - pull_request: - branches: [ "dev" ] env: SOLUTION_FILE_PATH: JG/johnnyguitar.sln @@ -75,7 +73,6 @@ jobs: prerelease: true body: | Continuous release generated from the latest push to development branch. - Last updated: ${{ env.artifact_timestamp }} - name: Upload Artifact (Release) uses: actions/upload-release-asset@v1 env: