|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: push |
| 4 | + |
| 5 | +concurrency: |
| 6 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 7 | + cancel-in-progress: true |
| 8 | + |
| 9 | +jobs: |
| 10 | + windows: |
| 11 | + strategy: |
| 12 | + fail-fast: true |
| 13 | + |
| 14 | + matrix: |
| 15 | + conf: |
| 16 | + - Release |
| 17 | + |
| 18 | + runs-on: windows-latest |
| 19 | + |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: Enable vcpkg downloads cache |
| 24 | + uses: actions/cache@v4 |
| 25 | + with: |
| 26 | + path: 'C:/vcpkg/downloads' |
| 27 | + key: vcpkg_downloads_cache_v1 |
| 28 | + |
| 29 | + - name: Enable vcpkg installed cache |
| 30 | + uses: actions/cache@v4 |
| 31 | + with: |
| 32 | + path: 'C:/vcpkg/installed' |
| 33 | + key: vcpkg_installed_cache_v1 |
| 34 | + |
| 35 | + - name: Install dependencies |
| 36 | + run: > |
| 37 | + vcpkg install --triplet x64-windows |
| 38 | + collada-dom |
| 39 | + freetype |
| 40 | + libiconv |
| 41 | + libjpeg-turbo |
| 42 | + libpng |
| 43 | + libxml2 |
| 44 | + opengl-registry |
| 45 | + tiff |
| 46 | + zlib |
| 47 | +
|
| 48 | + - uses: ilammy/msvc-dev-cmd@v1 |
| 49 | + |
| 50 | + - name: Configure |
| 51 | + run: > |
| 52 | + cmake |
| 53 | + -G Ninja |
| 54 | + -B ${{ github.workspace }}/build |
| 55 | + -D CMAKE_BUILD_TYPE=${{ matrix.conf }} |
| 56 | + -D CMAKE_TOOLCHAIN_FILE='C:/vcpkg/scripts/buildsystems/vcpkg.cmake' |
| 57 | + -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/build/install |
| 58 | + -D CMAKE_CXX_STANDARD=11 |
| 59 | + -D CMAKE_C_FLAGS='/DWIN32 /D_WINDOWS /Zi' |
| 60 | + -D CMAKE_CXX_FLAGS='/DWIN32 /D_WINDOWS /GR /EHsc /Zi' |
| 61 | + -D OPENGL_PROFILE=GL2 |
| 62 | + -D OSG_MSVC_VERSIONED_DLL=OFF |
| 63 | + -D OSG_DETERMINE_WIN_VERSION=OFF |
| 64 | + -D OSG_FIND_3RD_PARTY_DEPS=OFF |
| 65 | + -D OSG_USE_UTF8_FILENAME=ON |
| 66 | + -D BUILD_OSG_PLUGINS_BY_DEFAULT=OFF |
| 67 | + -D BUILD_OSG_PLUGIN_OSG=ON |
| 68 | + -D BUILD_OSG_PLUGIN_DDS=ON |
| 69 | + -D BUILD_OSG_PLUGIN_TGA=ON |
| 70 | + -D BUILD_OSG_PLUGIN_BMP=ON |
| 71 | + -D BUILD_OSG_PLUGIN_JPEG=ON |
| 72 | + -D BUILD_OSG_PLUGIN_PNG=ON |
| 73 | + -D BUILD_OSG_PLUGIN_FREETYPE=ON |
| 74 | + -D BUILD_OSG_PLUGIN_DAE=ON |
| 75 | + -D BUILD_OSG_PLUGIN_KTX=ON |
| 76 | + -D BUILD_OSG_APPLICATIONS=OFF |
| 77 | + -D BUILD_OSG_DEPRECATED_SERIALIZERS=OFF |
| 78 | + -D DYNAMIC_OPENTHREADS=ON |
| 79 | + -D DYNAMIC_OPENSCENEGRAPH=ON |
| 80 | +
|
| 81 | + - name: Build |
| 82 | + run: cmake --build ${{ github.workspace }}/build --parallel |
| 83 | + |
| 84 | + - name: Install |
| 85 | + run: cmake --install ${{ github.workspace }}/build |
| 86 | + |
| 87 | + - name: Store osg build artifacts |
| 88 | + uses: actions/upload-artifact@v4 |
| 89 | + with: |
| 90 | + name: osg-${{ github.sha }} |
| 91 | + path: ${{ github.workspace }}/build/install |
| 92 | + |
| 93 | + - name: Store osg dependencies build artifacts |
| 94 | + uses: actions/upload-artifact@v4 |
| 95 | + with: |
| 96 | + name: osg-dependencies-${{ github.sha }} |
| 97 | + path: 'C:/vcpkg/installed' |
0 commit comments