|
| 1 | +name: CMake Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main, Navpower ] |
| 6 | + release: |
| 7 | + types: [ created ] |
| 8 | + pull_request: |
| 9 | + types: [ opened, synchronize, reopened ] |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + runs-on: windows-latest |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + preset: [ x64-debug ] |
| 17 | + steps: |
| 18 | + - name: Set up CMake |
| 19 | + uses: lukka/get-cmake@latest |
| 20 | + with: |
| 21 | + cmakeVersion: "~3.28.0" |
| 22 | + |
| 23 | + - name: Checkout |
| 24 | + uses: actions/checkout@v4 |
| 25 | + with: |
| 26 | + submodules: recursive |
| 27 | + |
| 28 | + - name: Setup VS environment |
| 29 | + uses: ilammy/msvc-dev-cmd@v1 |
| 30 | + with: |
| 31 | + arch: x64 |
| 32 | + |
| 33 | + - name: Build and install debug |
| 34 | + run: | |
| 35 | + cmake --preset x64-debug . |
| 36 | + cmake --build build/x64-debug -j12 |
| 37 | +
|
| 38 | +# - name: Build and install release |
| 39 | +# run: | |
| 40 | +# cmake --preset x64-Release . |
| 41 | +# cmake --build build/x64-Release -j12 |
| 42 | +# cmake --install build/x64-Release |
| 43 | + |
| 44 | + - name: Copy debug artifacts |
| 45 | + run: | |
| 46 | + mkdir _dist-debug |
| 47 | + Copy-Item build/x64-debug/src/* -Destination _dist-debug/ -Recurse |
| 48 | +
|
| 49 | +# - name: Copy release artifacts |
| 50 | +# run: | |
| 51 | +# mkdir _dist-release |
| 52 | +# Copy-Item _install/x64-Release/bin/* -Destination _dist-release/ -Recurse |
| 53 | + |
| 54 | + - name: Archive debug NavKit |
| 55 | + uses: actions/upload-artifact@v4 |
| 56 | + with: |
| 57 | + name: NavKit-Debug |
| 58 | + path: _dist-debug/* |
| 59 | + |
| 60 | +# - name: Archive release Navkit |
| 61 | +# uses: actions/upload-artifact@v4 |
| 62 | +# with: |
| 63 | +# name: NavKit-Release |
| 64 | +# path: _dist-release/* |
| 65 | + |
| 66 | + upload_release: |
| 67 | + name: Upload artifacts |
| 68 | + needs: build |
| 69 | + #if: github.event_name == 'release' |
| 70 | + runs-on: ubuntu-latest |
| 71 | + |
| 72 | + strategy: |
| 73 | + matrix: |
| 74 | + artifact: |
| 75 | +# - NavKit-Release |
| 76 | + - NavKit-Debug |
| 77 | + |
| 78 | + steps: |
| 79 | + - name: Download artifact |
| 80 | + uses: actions/download-artifact@v4 |
| 81 | + with: |
| 82 | + name: ${{ matrix.artifact }} |
| 83 | + path: ${{ matrix.artifact }} |
| 84 | + |
| 85 | + - name: Archive artifact files |
| 86 | + run: | |
| 87 | + cd ${{ matrix.artifact }} |
| 88 | + zip -r ${{ matrix.artifact }}.zip * |
0 commit comments