Skip to content

Commit edbd36d

Browse files
authored
Update build.yaml
1 parent 3ee80d7 commit edbd36d

File tree

1 file changed

+39
-8
lines changed

1 file changed

+39
-8
lines changed

.github/workflows/build.yaml

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,33 +139,64 @@ jobs:
139139
- name: Build
140140
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
141141

142-
- name: Rename artifacts
142+
- name: Rename artifacts (Windows)
143+
if: matrix.config.name == 'windows'
144+
shell: pwsh
145+
run: |
146+
$buildDir = "${{github.workspace}}\build"
147+
Set-Location $buildDir
148+
149+
# Find the built DLL
150+
$original = Get-ChildItem -Recurse -Filter "*NativePredicateSolver*.dll" | Select-Object -First 1
151+
152+
if ($null -eq $original) {
153+
Write-Error "Error: Could not find built library"
154+
exit 1
155+
}
156+
157+
Write-Host "Found: $($original.FullName)"
158+
159+
# Determine new name based on version
160+
if ("${{ matrix.version.full_version }}" -eq "dev") {
161+
$newName = "NativePredicateSolver-dev.dll"
162+
} else {
163+
$newName = "NativePredicateSolver-${{ matrix.version.full_version }}.dll"
164+
}
165+
166+
Write-Host "Copying to: $newName"
167+
Copy-Item -Path $original.FullName -Destination $newName
168+
169+
# Set output for upload step
170+
echo "artifact_name=$newName" >> $env:GITHUB_ENV
171+
172+
- name: Rename artifacts (Unix)
173+
if: matrix.config.name != 'windows'
143174
shell: bash
144175
run: |
145176
cd ${{github.workspace}}/build
146177
147178
# Find the built library
148-
if [[ "${{ matrix.config.ext }}" == "dll" ]]; then
149-
ORIGINAL=$(find . -name "NativePredicateSolver.dll" -o -name "NativePredicateSolver*.dll" | head -n 1)
150-
elif [[ "${{ matrix.config.ext }}" == "so" ]]; then
151-
ORIGINAL=$(find . -name "libNativePredicateSolver.so" -o -name "libNativePredicateSolver*.so" | head -n 1)
179+
if [[ "${{ matrix.config.ext }}" == "so" ]]; then
180+
ORIGINAL=$(find . -type f -name "libNativePredicateSolver.so" -o -name "libNativePredicateSolver*.so" | head -n 1)
152181
else
153-
ORIGINAL=$(find . -name "libNativePredicateSolver.dylib" -o -name "libNativePredicateSolver*.dylib" | head -n 1)
182+
ORIGINAL=$(find . -type f -name "libNativePredicateSolver.dylib" -o -name "libNativePredicateSolver*.dylib" | head -n 1)
154183
fi
155184
156185
if [[ -z "$ORIGINAL" ]]; then
157186
echo "Error: Could not find built library"
158187
exit 1
159188
fi
160189
161-
# Determine new name based on version (consistent across all platforms)
190+
echo "Found: $ORIGINAL"
191+
192+
# Determine new name based on version
162193
if [[ "${{ matrix.version.full_version }}" == "dev" ]]; then
163194
NEW_NAME="NativePredicateSolver-dev.${{ matrix.config.ext }}"
164195
else
165196
NEW_NAME="NativePredicateSolver-${{ matrix.version.full_version }}.${{ matrix.config.ext }}"
166197
fi
167198
168-
echo "Renaming $ORIGINAL to $NEW_NAME"
199+
echo "Copying to: $NEW_NAME"
169200
cp "$ORIGINAL" "$NEW_NAME"
170201
echo "artifact_name=$NEW_NAME" >> $GITHUB_ENV
171202

0 commit comments

Comments
 (0)