|
| 1 | +name: Build PhysX (Linux) |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v5.6.0-test' |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + name: Build Linux - ${{ matrix.config }} |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + config: [debug, release, profile, checked] |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: Checkout repository |
| 20 | + uses: actions/checkout@v4 |
| 21 | + with: |
| 22 | + repository: NVIDIA-Omniverse/PhysX |
| 23 | + ref: 107.0-physx-5.6.0 |
| 24 | + |
| 25 | + - name: Install dependencies |
| 26 | + run: | |
| 27 | + sudo apt update |
| 28 | + sudo apt install -y ninja-build cmake clang python3 libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libgl1-mesa-dev |
| 29 | +
|
| 30 | + - name: Download preset from GitHub |
| 31 | + run: | |
| 32 | + curl -L -o linux-cpu-only.xml https://raw.githubusercontent.com/Lumengine/PhysXBuild/main/linux-cpu-only.xml |
| 33 | +
|
| 34 | + - name: Copy preset into repo |
| 35 | + run: | |
| 36 | + cp linux-cpu-only.xml ./physx/buildtools/presets/public/ |
| 37 | +
|
| 38 | + - name: Generate Projects |
| 39 | + run: | |
| 40 | + chmod +x ./generate_projects.sh |
| 41 | + ./generate_projects.sh linux-cpu-only |
| 42 | + working-directory: physx |
| 43 | + |
| 44 | + - name: Build |
| 45 | + continue-on-error: true |
| 46 | + run: cmake --build ./compiler/linux-cpu-only --config ${{ matrix.config }} |
| 47 | + working-directory: physx |
| 48 | + |
| 49 | + - name: Package build output |
| 50 | + id: build |
| 51 | + run: | |
| 52 | + mkdir -p output/bin |
| 53 | + mkdir -p output/lib |
| 54 | + mkdir -p output/include |
| 55 | + mkdir -p output/documentation |
| 56 | +
|
| 57 | + binArchiveName="PhysX-5.6.0.linux.x86_64.clang.${{ matrix.config }}.tar.gz" |
| 58 | + echo "PHYSX_BINARY_ARCHIVE=$binArchiveName" >> "$GITHUB_OUTPUT" |
| 59 | +
|
| 60 | + # Copy shared libraries |
| 61 | + cp physx/bin/linux.clang/${{ matrix.config }}/*.so output/bin/ 2>/dev/null || true |
| 62 | + cp physx/bin/linux.clang/${{ matrix.config }}/*.a output/lib/ 2>/dev/null || true |
| 63 | +
|
| 64 | + # Copy headers and documentation |
| 65 | + cp -r physx/include/* output/include/ |
| 66 | + cp -r physx/documentation/* output/documentation/ 2>/dev/null || true |
| 67 | +
|
| 68 | + # Create archive |
| 69 | + tar -czf "$binArchiveName" -C output . |
| 70 | +
|
| 71 | + - name: Publish |
| 72 | + uses: softprops/action-gh-release@v1 |
| 73 | + with: |
| 74 | + files: | |
| 75 | + ${{ steps.build.outputs.PHYSX_BINARY_ARCHIVE }} |
| 76 | + env: |
| 77 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments