|
41 | 41 | with: |
42 | 42 | arch: x64 |
43 | 43 |
|
44 | | - - name: Build |
| 44 | + - name: Build x64 |
45 | 45 | run: | |
46 | | - cmake -G "Ninja" -B build -DCMAKE_BUILD_TYPE=Release |
47 | | - cmake --build build |
| 46 | + cmake -G "Ninja" -B build_x64 -DCMAKE_BUILD_TYPE=Release |
| 47 | + cmake --build build_x64 |
| 48 | +
|
| 49 | + - name: Build x86 |
| 50 | + run: | |
| 51 | + cmake -G "Ninja" -B build_x86 -DCMAKE_BUILD_TYPE=Release -A Win32 |
| 52 | + cmake --build build_x86 |
| 53 | +
|
| 54 | + - name: Get short Git hash |
| 55 | + id: git_hash |
| 56 | + run: echo "sha=$(git rev-parse --short HEAD)" >> $env:GITHUB_OUTPUT |
| 57 | + |
| 58 | + - name: Stage artifact layout |
| 59 | + run: | |
| 60 | + $root = "CANvenient" |
| 61 | + New-Item -ItemType Directory -Force -Path "$root/bin/x64" |
| 62 | + New-Item -ItemType Directory -Force -Path "$root/bin/x86" |
| 63 | + New-Item -ItemType Directory -Force -Path "$root/include" |
| 64 | + New-Item -ItemType Directory -Force -Path "$root/lib/x64" |
| 65 | + New-Item -ItemType Directory -Force -Path "$root/lib/x86" |
| 66 | +
|
| 67 | + Copy-Item build_x64/CANvenient.dll "$root/bin/x64/CANvenient.dll" |
| 68 | + Copy-Item build_x64/CANvenient.lib "$root/lib/x64/CANvenient.lib" |
| 69 | + Copy-Item build_x86/CANvenient.dll "$root/bin/x86/CANvenient.dll" |
| 70 | + Copy-Item build_x86/CANvenient.lib "$root/lib/x86/CANvenient.lib" |
| 71 | +
|
| 72 | + $vendorDlls_x64 = @("canchd_64.dll","canL2_64.dll","canlib32.dll","CANusbM.dll","PCANBasic.dll","vciapi.dll") |
| 73 | + foreach ($dll in $vendorDlls_x64) { |
| 74 | + if (Test-Path "build_x64/$dll") { Copy-Item "build_x64/$dll" "$root/bin/x64/$dll" } |
| 75 | + } |
| 76 | +
|
| 77 | + $vendorDlls_x86 = @("canchd_64.dll","canL2.dll","canlib32.dll","CANusbM.dll","PCANBasic.dll") |
| 78 | + foreach ($dll in $vendorDlls_x86) { |
| 79 | + if (Test-Path "build_x86/$dll") { Copy-Item "build_x86/$dll" "$root/bin/x86/$dll" } |
| 80 | + } |
| 81 | +
|
| 82 | + Copy-Item include/CANvenient.h "$root/include/CANvenient.h" |
| 83 | + Copy-Item LICENSE.md "$root/LICENSE.md" |
| 84 | + Copy-Item README.md "$root/README.md" |
| 85 | +
|
| 86 | + Compress-Archive -Path "$root" -DestinationPath "CANvenient-${{ steps.git_hash.outputs.sha }}.zip" |
| 87 | +
|
| 88 | + - name: Upload build artifacts |
| 89 | + uses: actions/upload-artifact@v6 |
| 90 | + with: |
| 91 | + name: build-artifacts |
| 92 | + path: CANvenient-${{ steps.git_hash.outputs.sha }}.zip |
0 commit comments