Only use ubuntu runners supported by github, avoid using containers w… #158
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: mingw | |
| on: | |
| push: | |
| pull_request: | |
| types: [ opened, reopened, synchronize ] | |
| jobs: | |
| build: | |
| name: build | |
| strategy: | |
| matrix: | |
| os: [windows-latest] | |
| # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
| BUILD_TYPE: [Release, Debug] | |
| BUILD_SHARED_LIBS: [OFF] | |
| defaults: | |
| run: | |
| shell: cmd | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| BUILD_TYPE: ${{ matrix.BUILD_TYPE }} | |
| SOURCE_DIR: ${{github.workspace}}\.cache\source | |
| TOOSL_DIR: ${{github.workspace}}\.cache\tools | |
| INSTALL_DIR: ${{github.workspace}}\.cache\install_mingw_2022_02_15 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install dependencies | |
| run: | | |
| C:\msys64\usr\bin\pacman.exe -S --noconfirm ^ | |
| mingw-w64-x86_64-cmake ^ | |
| mingw-w64-x86_64-make ^ | |
| mingw-w64-x86_64-nsis ^ | |
| mingw-w64-x86_64-gcc ^ | |
| mingw-w64-x86_64-zlib ^ | |
| mingw-w64-x86_64-openssl ^ | |
| mingw-w64-x86_64-libevent ^ | |
| mingw-w64-x86_64-sqlite3 ^ | |
| mingw-w64-x86_64-hiredis ^ | |
| mingw-w64-x86_64-postgresql ^ | |
| mingw-w64-x86_64-libmicrohttpd ^ | |
| git base-devel | |
| env: | |
| PATH: C:\msys64\usr\bin | |
| - name: pacman | |
| env: | |
| PATH: C:\msys64\usr\bin | |
| run: | | |
| C:\msys64\usr\bin\pacman.exe -S --noconfirm ^ | |
| mingw-w64-x86_64-cmake ^ | |
| mingw-w64-x86_64-make ^ | |
| mingw-w64-x86_64-nsis ^ | |
| mingw-w64-x86_64-gcc ^ | |
| mingw-w64-x86_64-zlib ^ | |
| mingw-w64-x86_64-openssl ^ | |
| mingw-w64-x86_64-libevent ^ | |
| mingw-w64-x86_64-sqlite3 ^ | |
| mingw-w64-x86_64-hiredis ^ | |
| mingw-w64-x86_64-postgresql ^ | |
| mingw-w64-x86_64-libmicrohttpd ^ | |
| git base-devel | |
| - name: make_directory | |
| run: | | |
| cmake -E make_directory ${{env.SOURCE_DIR}} | |
| cmake -E make_directory ${{env.TOOSL_DIR}} | |
| cmake -E make_directory ${{env.INSTALL_DIR}} | |
| - name: Cache installed | |
| uses: actions/cache@v4 | |
| id: cache-installed | |
| with: | |
| path: | | |
| ${{env.INSTALL_DIR}} | |
| key: coturn-cache-installed-mingw | |
| - name: build prometheus | |
| if: false | |
| working-directory: ${{env.SOURCE_DIR}} | |
| env: | |
| MSYSTEM: MINGW64 | |
| PATH: C:\msys64\mingw64\bin;C:\msys64\usr\bin | |
| run: | | |
| cd ${{env.SOURCE_DIR}} | |
| git clone https://github.com/digitalocean/prometheus-client-c.git | |
| cd prometheus-client-c/prom | |
| mkdir build | |
| cd build | |
| cmake .. -G"MinGW Makefiles" ^ | |
| -DBUILD_SHARED_LIBS=${{matrix.BUILD_SHARED_LIBS}} ^ | |
| -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} ^ | |
| -DCMAKE_INSTALL_PREFIX=${{env.INSTALL_DIR}} | |
| cmake --build . --config ${{matrix.BUILD_TYPE}} | |
| cmake --build . --config ${{matrix.BUILD_TYPE}} --target install | |
| - name: build coturn | |
| working-directory: ${{github.workspace}} | |
| env: | |
| MSYSTEM: MINGW64 | |
| PATH: C:\msys64\mingw64\bin;C:\msys64\usr\bin | |
| Prometheus_ROOT: ${{env.INSTALL_DIR}} | |
| run: | | |
| cmake -E make_directory build | |
| cd build | |
| cmake .. -G"MinGW Makefiles" ^ | |
| -DBUILD_SHARED_LIBS=${{matrix.BUILD_SHARED_LIBS}} ^ | |
| -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} ^ | |
| -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/install | |
| cmake --build . --config ${{matrix.BUILD_TYPE}} | |
| cmake --build . --config ${{matrix.BUILD_TYPE}} --target install | |
| - name: Package | |
| if: ${{ matrix.BUILD_TYPE == 'Release' }} | |
| working-directory: ${{github.workspace}}\build | |
| run: | | |
| copy /Y ${{env.INSTALL_DIR}}\bin\*.dll install\bin | |
| copy /Y ${{env.INSTALL_DIR}}\lib\*.dll install\bin | |
| copy /Y ${{env.RUNVCPKG_VCPKG_ROOT}}\installed\${{env.RUNVCPKG_VCPKG_TRIPLET_OUT}}\bin\*.dll install\bin | |
| 7z a coturn_windows_mingw.zip ${{github.workspace}}\build\install\* | |
| cmake --build . --config ${{matrix.BUILD_TYPE}} --target package | |
| - name: update | |
| if: ${{ matrix.BUILD_TYPE == 'Release' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coturn_mingw_${{ matrix.os }} | |
| path: | | |
| ${{github.workspace}}\build\coturn_windows_mingw.zip | |
| ${{github.workspace}}\build\coturn*.exe | |
| ${{github.workspace}}\build\coturn*.md5 |