Skip to content

Commit 6f77403

Browse files
committed
a
1 parent f7db18c commit 6f77403

File tree

3 files changed

+98
-151
lines changed

3 files changed

+98
-151
lines changed

.github/workflows/cmake-experimental.yml

Lines changed: 26 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -24,64 +24,51 @@ concurrency:
2424
cancel-in-progress: true
2525

2626
jobs:
27+
build:
28+
uses: ./.github/workflows/cmake_build_ue4ss.yml
29+
secrets: inherit
30+
with:
31+
build-mode: "Game__Shipping__Win64"
32+
commit-sha: ${{ github.sha }}
33+
should-upload-artifact: true
34+
artifact-retention-days: 1
35+
2736
make-release:
37+
needs: build
2838
permissions: write-all
2939
runs-on: windows-2022
30-
3140
steps:
3241
- name: Checkout
3342
uses: actions/checkout@v4
3443
with:
3544
submodules: recursive
36-
fetch-depth: 0 # needed to get commits since last tag
45+
fetch-depth: 0
3746
token: ${{ secrets.UEPSEUDO_PAT }}
3847

3948
- name: Setup Python
4049
uses: actions/setup-python@v4
4150
with:
4251
python-version: '3.9'
4352

44-
# Specifically use MSVC toolset v19.39.33523
45-
- name: Install VS2022 BuildTools 17.9.7
46-
run: choco install -y visualstudio2022buildtools --version=117.9.7.0 --params "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --installChannelUri https://aka.ms/vs/17/release/180911598_-255012421/channel"
47-
48-
- name: Setup CMake and Ninja
49-
run: |
50-
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
51-
choco install ninja
52-
53-
- name: Configure CMake
54-
shell: pwsh
55-
run: |
56-
Import-Module 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll'
57-
Enter-VsDevShell -VsInstallPath 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools' -DevCmdArguments '-arch=x64 -host_arch=x64'
58-
59-
cmake -B build_experimental `
60-
-G Ninja `
61-
-DCMAKE_BUILD_TYPE=Game__Shipping__Win64 `
62-
-DCMAKE_C_COMPILER=cl `
63-
-DCMAKE_CXX_COMPILER=cl
64-
65-
- name: Build
66-
shell: pwsh
67-
run: |
68-
cmake --build build_experimental --target UE4SS
53+
- name: Download Build Artifacts
54+
uses: actions/download-artifact@v4
55+
with:
56+
name: CMAKE-Game__Shipping__Win64
57+
path: build_output/
6958

70-
# The release script expects binaries in specific locations
71-
- name: Prepare for packaging
59+
- name: Verify downloaded files
7260
shell: pwsh
7361
run: |
74-
# Find UE4SS.dll and ensure it's where the release script expects
75-
$buildDir = "build_experimental"
76-
77-
$dllPath = Get-ChildItem -Path $buildDir -Recurse -Filter "UE4SS.dll" | Select-Object -First 1
78-
$pdbPath = Get-ChildItem -Path $buildDir -Recurse -Filter "UE4SS.pdb" | Select-Object -First 1
62+
Write-Host "Contents of build_output:"
63+
Get-ChildItem -Path "build_output" -Recurse | ForEach-Object { Write-Host $_.FullName }
7964
80-
if ($dllPath) {
81-
Write-Host "Found UE4SS.dll at: $($dllPath.FullName)"
82-
} else {
83-
Write-Error "UE4SS.dll not found!"
84-
exit 1
65+
$requiredFiles = @("UE4SS.dll", "dwmapi.dll")
66+
foreach ($file in $requiredFiles) {
67+
$filePath = Get-ChildItem -Path "build_output" -Recurse -Filter $file -ErrorAction SilentlyContinue | Select-Object -First 1
68+
if (-not $filePath) {
69+
Write-Error "$file not found in downloaded artifacts!"
70+
exit 1
71+
}
8572
}
8673
8774
- name: Package

.github/workflows/cmake-release.yml

Lines changed: 50 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -9,75 +9,72 @@ concurrency:
99
cancel-in-progress: true
1010

1111
jobs:
12+
prepare-release:
13+
permissions: write-all
14+
runs-on: ubuntu-latest
15+
outputs:
16+
release_tag: ${{ steps.release_tag.outputs.release_tag }}
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
token: ${{ secrets.UEPSEUDO_PAT }}
23+
24+
- name: Create Test Release Tag
25+
id: release_tag
26+
run: |
27+
timestamp=$(date +'%Y%m%d-%H%M%S')
28+
testTag="cmake-test-$timestamp"
29+
echo "release_tag=$testTag" >> $GITHUB_OUTPUT
30+
echo "Test release tag: $testTag"
31+
32+
build:
33+
needs: prepare-release
34+
uses: ./.github/workflows/cmake_build_ue4ss.yml
35+
secrets: inherit
36+
with:
37+
build-mode: "Game__Shipping__Win64"
38+
commit-sha: ${{ github.sha }}
39+
should-upload-artifact: true
40+
artifact-retention-days: 1
41+
1242
make-release:
43+
needs: [prepare-release, build]
1344
permissions: write-all
1445
runs-on: windows-2022
15-
1646
steps:
1747
- name: Checkout
1848
uses: actions/checkout@v4
1949
with:
2050
submodules: recursive
21-
fetch-depth: 0 # needed to get commits since last tag
51+
fetch-depth: 0
2252
token: ${{ secrets.UEPSEUDO_PAT }}
2353

2454
- name: Setup Python
2555
uses: actions/setup-python@v4
2656
with:
2757
python-version: '3.9'
2858

29-
# Specifically use MSVC toolset v19.39.33523
30-
- name: Install VS2022 BuildTools 17.9.7
31-
run: choco install -y visualstudio2022buildtools --version=117.9.7.0 --params "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --installChannelUri https://aka.ms/vs/17/release/180911598_-255012421/channel"
32-
33-
- name: Setup CMake and Ninja
34-
run: |
35-
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
36-
choco install ninja
37-
38-
- name: Create Test Release Tag
39-
id: release_tag
40-
run: |
41-
$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"
42-
$testTag = "cmake-test-$timestamp"
43-
echo "release_tag=$testTag" >> $env:GITHUB_OUTPUT
44-
echo "Test release tag: $testTag"
45-
46-
- name: Configure and Build
47-
shell: pwsh
48-
run: |
49-
Import-Module 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll'
50-
Enter-VsDevShell -VsInstallPath 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools' -DevCmdArguments '-arch=x64 -host_arch=x64'
51-
52-
cmake -B build_release `
53-
-G Ninja `
54-
-DCMAKE_BUILD_TYPE=Game__Shipping__Win64 `
55-
-DCMAKE_C_COMPILER=cl `
56-
-DCMAKE_CXX_COMPILER=cl
57-
58-
cmake --build build_release --target UE4SS
59+
- name: Download Build Artifacts
60+
uses: actions/download-artifact@v4
61+
with:
62+
name: CMAKE-Game__Shipping__Win64
63+
path: build_output/
5964

60-
# The release script expects binaries in specific locations
61-
# CMake outputs to build_release/bin or build_release/
62-
- name: Prepare for packaging
65+
- name: Verify downloaded files
6366
shell: pwsh
6467
run: |
65-
# Create expected directory structure
66-
$buildDir = "build_release"
67-
68-
# Find UE4SS.dll and UE4SS.pdb
69-
$dllPath = Get-ChildItem -Path $buildDir -Recurse -Filter "UE4SS.dll" | Select-Object -First 1
70-
$pdbPath = Get-ChildItem -Path $buildDir -Recurse -Filter "UE4SS.pdb" | Select-Object -First 1
71-
72-
if ($dllPath) {
73-
Write-Host "Found UE4SS.dll at: $($dllPath.FullName)"
74-
} else {
75-
Write-Error "UE4SS.dll not found!"
76-
exit 1
77-
}
68+
Write-Host "Contents of build_output:"
69+
Get-ChildItem -Path "build_output" -Recurse | ForEach-Object { Write-Host $_.FullName }
7870
79-
if ($pdbPath) {
80-
Write-Host "Found UE4SS.pdb at: $($pdbPath.FullName)"
71+
$requiredFiles = @("UE4SS.dll", "dwmapi.dll")
72+
foreach ($file in $requiredFiles) {
73+
$filePath = Get-ChildItem -Path "build_output" -Recurse -Filter $file -ErrorAction SilentlyContinue | Select-Object -First 1
74+
if (-not $filePath) {
75+
Write-Error "$file not found in downloaded artifacts!"
76+
exit 1
77+
}
8178
}
8279
8380
- name: Package
@@ -102,13 +99,13 @@ jobs:
10299
- name: Create Test Release
103100
uses: softprops/action-gh-release@v1
104101
with:
105-
tag_name: ${{ steps.release_tag.outputs.release_tag }}
106-
name: "CMake Test Release - ${{ steps.release_tag.outputs.release_tag }}"
102+
tag_name: ${{ needs.prepare-release.outputs.release_tag }}
103+
name: "CMake Test Release - ${{ needs.prepare-release.outputs.release_tag }}"
107104
body_path: release/release_notes.md
108105
draft: true
109106
prerelease: true
110107
files: |
111108
release/UE4SS_v*.zip
112109
release/zDEV-UE4SS_v*.zip
113110
release/zCustomGameConfigs.zip
114-
release/zMapGenBP.zip
111+
release/zMapGenBP.zip
Lines changed: 22 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Summary
22
# This reusable workflow handles building UE4SS with CMake, including setup of dependencies and uploading of artifacts.
3-
# Any future workflows/tasks that require UE4SS to be built should call this reusable workflow to ensure consistency.
43
name: "Build UE4SS with CMake"
54
permissions:
65
contents: read
@@ -19,10 +18,6 @@ on:
1918
description: 'Should build output be uploaded as an artifact?'
2019
type: boolean
2120
default: false
22-
artifact-list:
23-
description: 'List of targets to upload artifacts for'
24-
type: string
25-
default: '["UE4SS"]'
2621
artifact-retention-days:
2722
description: 'How many days to retain artifacts'
2823
type: number
@@ -41,18 +36,14 @@ jobs:
4136
token: ${{ secrets.UEPSEUDO_PAT }}
4237
ref: ${{inputs.commit-sha}}
4338

44-
# Store the current week (00-53) to use as part of the cache key.
45-
# This saves us from having to detect older caches and delete them.
4639
- name: Get current week as package key
4740
id: cache_key
4841
run: echo "key=$(date +'%W')" >> $GITHUB_OUTPUT
4942
shell: bash
5043

51-
# Specifically use MSVC toolset v19.39.33523
5244
- name: Install VS2022 BuildTools 17.9.7
5345
run: choco install -y visualstudio2022buildtools --version=117.9.7.0 --params "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --installChannelUri https://aka.ms/vs/17/release/180911598_-255012421/channel"
5446

55-
# Setup CMake and Ninja
5647
- name: Setup CMake
5748
uses: jwlawson/actions-setup-cmake@v2
5849
with:
@@ -61,16 +52,15 @@ jobs:
6152
- name: Setup Ninja
6253
uses: seanmiddleditch/gha-setup-ninja@v5
6354

64-
# Create build directory name based on mode
6555
- name: Create build directory name
6656
id: build_dir
6757
run: |
6858
$mode = "${{inputs.build-mode}}"
6959
$buildDir = "build_cmake_$mode"
7060
echo "name=$buildDir" >> $env:GITHUB_OUTPUT
7161
72-
# Configure CMake
73-
- name: Configure CMake
62+
# FIXED: Combined Configure and Build, added proxy target
63+
- name: Configure and Build
7464
run: |
7565
Import-Module 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll'
7666
Enter-VsDevShell -VsInstallPath 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools' -DevCmdArguments '-arch=x64 -host_arch=x64'
@@ -81,65 +71,38 @@ jobs:
8171
-DCMAKE_C_COMPILER=cl `
8272
-DCMAKE_CXX_COMPILER=cl `
8373
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
84-
85-
# Build
86-
- name: Build
87-
id: build
88-
run: |
89-
cmake --build ${{ steps.build_dir.outputs.name }} --target UE4SS
9074
91-
# Get the actual output path
92-
$outputPath = "${{ steps.build_dir.outputs.name }}/bin"
93-
echo "output_path=$outputPath" >> $env:GITHUB_OUTPUT
75+
# Build both UE4SS and proxy targets
76+
cmake --build ${{ steps.build_dir.outputs.name }} --target UE4SS
77+
cmake --build ${{ steps.build_dir.outputs.name }} --target proxy
9478
95-
# Collect files for artifact
79+
# FIXED: Collect all required artifacts including dwmapi.dll
9680
- name: Calculate Files For Artifact Inclusion
9781
id: calc-files-artifact
9882
if: ${{inputs.should-upload-artifact == true}}
9983
run: |
10084
$artifact_dir = New-Item -Path '${{runner.temp}}/ue4ss_artifacts/' -ItemType Directory -Force
85+
$buildDir = "${{ steps.build_dir.outputs.name }}"
10186
102-
# Find all DLL and PDB files in the output directory
103-
$outputPath = "${{ steps.build.outputs.output_path }}"
104-
105-
# Copy UE4SS.dll and UE4SS.pdb if they exist
106-
$dllPath = Join-Path $outputPath "UE4SS.dll"
107-
$pdbPath = Join-Path $outputPath "UE4SS.pdb"
108-
109-
if (Test-Path $dllPath) {
110-
Write-Host "Found: $dllPath"
111-
Copy-Item $dllPath -Destination $artifact_dir
112-
}
113-
114-
if (Test-Path $pdbPath) {
115-
Write-Host "Found: $pdbPath"
116-
Copy-Item $pdbPath -Destination $artifact_dir
117-
}
118-
119-
# Also check in the build directory root
120-
$buildRoot = "${{ steps.build_dir.outputs.name }}"
121-
$dllPathRoot = Join-Path $buildRoot "UE4SS.dll"
122-
$pdbPathRoot = Join-Path $buildRoot "UE4SS.pdb"
123-
124-
if ((Test-Path $dllPathRoot) -and !(Test-Path (Join-Path $artifact_dir "UE4SS.dll"))) {
125-
Write-Host "Found in root: $dllPathRoot"
126-
Copy-Item $dllPathRoot -Destination $artifact_dir
127-
}
128-
129-
if ((Test-Path $pdbPathRoot) -and !(Test-Path (Join-Path $artifact_dir "UE4SS.pdb"))) {
130-
Write-Host "Found in root: $pdbPathRoot"
131-
Copy-Item $pdbPathRoot -Destination $artifact_dir
87+
# Find and copy UE4SS files
88+
$files = @("UE4SS.dll", "UE4SS.pdb", "dwmapi.dll")
89+
foreach ($fileName in $files) {
90+
$filePath = Get-ChildItem -Path $buildDir -Recurse -Filter $fileName -ErrorAction SilentlyContinue | Select-Object -First 1
91+
if ($filePath) {
92+
Write-Host "Found: $($filePath.FullName)"
93+
Copy-Item $filePath.FullName -Destination $artifact_dir
94+
} else {
95+
Write-Host "Warning: $fileName not found"
96+
}
13297
}
13398
134-
echo "artifact_dir=$artifact_dir" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
99+
echo "artifact_dir=$artifact_dir" >> $env:GITHUB_OUTPUT
135100
136101
- name: Upload a Build Artifact
137-
id: upload-artifact
138-
uses: actions/[email protected]
139102
if: ${{inputs.should-upload-artifact == true}}
103+
uses: actions/upload-artifact@v4
140104
with:
141-
name: MSVC-CMAKE-${{inputs.build-mode}}
142-
path: |
143-
${{ steps.calc-files-artifact.outputs.artifact_dir }}
144-
retention-days: ${{fromJSON(inputs.artifact-retention-days)}}
105+
name: CMAKE-${{inputs.build-mode}}
106+
path: ${{ steps.calc-files-artifact.outputs.artifact_dir }}
107+
retention-days: ${{inputs.artifact-retention-days}}
145108
overwrite: true

0 commit comments

Comments
 (0)