From a5fd5fc0125a0539aa7f9b9db12686ba851fad04 Mon Sep 17 00:00:00 2001 From: Quy Le Anh Date: Mon, 7 Apr 2025 15:26:20 +0900 Subject: [PATCH 1/2] Update msbuild.yml Correct release file path --- .github/workflows/msbuild.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index cd5611a..5b4cdf7 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -40,8 +40,8 @@ jobs: with: name: OpenKey path: | - ${{env.SOLUTION_FILE_PATH}}/Release/ - ${{env.SOLUTION_FILE_PATH}}/x64/Release/ + ${{env.SOLUTION_FILE_PATH}}/Release/x32 + ${{env.SOLUTION_FILE_PATH}}/Release/x64 outputs: subject-name: OpenKey From 496e1016b5a1f6dae363ca7a7e87f3cf9b54e0c8 Mon Sep 17 00:00:00 2001 From: Quy Le Anh Date: Tue, 8 Apr 2025 01:57:08 +0000 Subject: [PATCH 2/2] Update msbuild workflow --- .github/workflows/msbuild.yml | 37 +++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 5b4cdf7..2fe1960 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -10,11 +10,6 @@ env: # Path to the solution file relative to the root of the project. SOLUTION_FILE_PATH: .\Sources\OpenKey\win32\OpenKey - # Configuration type to build. - # You can convert this to a build matrix if you need coverage of multiple configuration types. - # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - BUILD_CONFIGURATION: Release - permissions: contents: read @@ -29,19 +24,37 @@ jobs: uses: microsoft/setup-msbuild@v2 - name: Build x86 - run: msbuild -m -target:Rebuild -p:Configuration=Release -p:Platform=x86 ${{env.SOLUTION_FILE_PATH}} + run: | + msbuild -m -target:Rebuild -p:Configuration=Release -p:Platform=x86 -p:OutDir="./Release/x86/" -p:IntDir="./Release/x86/" ${{env.SOLUTION_FILE_PATH}} - name: Build x64 - run: msbuild -m -target:Rebuild -p:Configuration=Release -p:Platform=x64 ${{env.SOLUTION_FILE_PATH}} + run: | + msbuild -m -target:Rebuild -p:Configuration=Release -p:Platform=x64 -p:OutDir="./Release/x64/" -p:IntDir="./Release/x64/" ${{env.SOLUTION_FILE_PATH}} + + - name: Prepare Artifact Directory + run: | + # Create target directories for both platforms + New-Item -Path "ArtifactOutput/Release/x86" -ItemType Directory -Force + New-Item -Path "ArtifactOutput/Release/x64" -ItemType Directory -Force + + # Copy x86 OpenKey and OpenKeyUpdate exes + Copy-Item -Path "Sources/OpenKey/win32/OpenKey/OpenKey/Release/x86/*.exe" -Destination "ArtifactOutput/Release/x86/" -Force + Copy-Item -Path "Sources/OpenKey/win32/OpenKey/OpenKeyUpdate/Release/x86/*.exe" -Destination "ArtifactOutput/Release/x86/" -Force + + # Copy x64 OpenKey and OpenKeyUpdate exes + Copy-Item -Path "Sources/OpenKey/win32/OpenKey/OpenKey/Release/x64/*.exe" -Destination "ArtifactOutput/Release/x64/" -Force + Copy-Item -Path "Sources/OpenKey/win32/OpenKey/OpenKeyUpdate/Release/x64/*.exe" -Destination "ArtifactOutput/Release/x64/" -Force + + # List files in the target directories to verify + Get-ChildItem -Path "ArtifactOutput/Release/x86" + Get-ChildItem -Path "ArtifactOutput/Release/x64" - - name: Upload a Build Artifact + - name: Archive and Upload Build Artifacts id: upload uses: actions/upload-artifact@v4 with: name: OpenKey - path: | - ${{env.SOLUTION_FILE_PATH}}/Release/x32 - ${{env.SOLUTION_FILE_PATH}}/Release/x64 + path: ArtifactOutput/Release/ outputs: subject-name: OpenKey @@ -61,4 +74,4 @@ jobs: uses: actions/attest-build-provenance@v2 with: subject-name: ${{needs.build.outputs.subject-name}} - subject-digest: sha256:${{needs.build.outputs.subject-digest}} + subject-digest: sha256:${{needs.build.outputs.subject-digest}} \ No newline at end of file