Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 25 additions & 12 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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/
${{env.SOLUTION_FILE_PATH}}/x64/Release/
path: ArtifactOutput/Release/

outputs:
subject-name: OpenKey
Expand All @@ -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}}