Update CMakeLists.txt #58
Workflow file for this run
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: Build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| GIT_SUBMODULE_STRATEGY: recursive | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-desktop: | |
| name: ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, ubuntu-latest] | |
| include: | |
| - os: windows-latest | |
| additional_cmake_flags: '-A x64 -DCMAKE_GENERATOR_TOOLSET=v142' | |
| steps: | |
| - name: Fetch sources | |
| uses: actions/checkout@v4 | |
| # Cache AUI boot directory | |
| - name: Cache AUI.BOOT deps | |
| id: cache-aui-boot | |
| uses: actions/cache@v3 | |
| env: | |
| cache-name: aui-boot | |
| with: | |
| path: ~/.aui | |
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/CMakeLists.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-build-${{ env.cache-name }}- | |
| ${{ runner.os }}-build- | |
| ${{ runner.os }}- | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install \ | |
| clang \ | |
| pkg-config \ | |
| libglew-dev \ | |
| zlib1g-dev \ | |
| libssl-dev \ | |
| libcrypt-dev \ | |
| libcurl4-openssl-dev \ | |
| libgtk-4-dev \ | |
| libadwaita-1-dev \ | |
| libdbus-1-dev \ | |
| libfontconfig-dev \ | |
| ninja-build \ | |
| libpulse-dev \ | |
| - name: Install macos dependencies | |
| if: runner.os == 'macos-latest' | |
| run: brew install ninja | |
| - name: Configure CMake | |
| run: cmake -G "${{ matrix.os=='windows-latest' && 'Visual Studio 17 2022' || 'Ninja' }}" -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Debug ${{matrix.additional_cmake_flags}} -DAUI_INSTALL_RUNTIME_DEPENDENCIES=TRUE | |
| - name: Build Project | |
| run: cmake --build ${{github.workspace}}/build --config Debug | |
| - name: Build Tests | |
| run: cmake --build ${{github.workspace}}/build --config Debug --target Tests | |
| - name: Run Tests (Windows) | |
| if: runner.os == 'Windows' | |
| working-directory: ${{github.workspace}}/build/bin/Debug/ | |
| run: ${{github.workspace}}/build/bin/Debug/Tests.exe | |
| - name: Run Tests (Linux and macOS) | |
| if: runner.os == 'Linux' | |
| working-directory: ${{github.workspace}}/build/bin | |
| run: ${{github.workspace}}/build/bin/Tests | |
| - name: Pack Windows Setup | |
| if: runner.os == 'Windows' | |
| working-directory: ${{github.workspace}}/build | |
| run: | | |
| cmake . -DAUI_APP_PACKAGING=INNOSETUP | |
| cmake --build . --config Debug | |
| cpack . -CDebug -B artifacts | |
| - name: Pack Windows Portable | |
| if: runner.os == 'Windows' | |
| working-directory: ${{github.workspace}}/build | |
| run: | | |
| cmake . -DAUI_APP_PACKAGING=AUI_PORTABLE_ZIP | |
| cmake --build . --config Debug | |
| cpack . -CDebug -B artifacts | |
| - name: Pack Linux Portable (ZIP) | |
| if: runner.os == 'Linux' | |
| working-directory: ${{github.workspace}}/build | |
| run: | | |
| cmake . -DAUI_APP_PACKAGING=AUI_PORTABLE_ZIP | |
| cmake --build . --config Debug | |
| cpack . -CDebug -B artifacts | |
| - name: Pack Linux Portable (tar.gz) | |
| if: runner.os == 'Linux' | |
| working-directory: ${{github.workspace}}/build | |
| run: | | |
| cmake . -DAUI_APP_PACKAGING=AUI_PORTABLE_TGZ | |
| cmake --build . --config Debug | |
| cpack . -CDebug -B artifacts | |
| - name: Upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: ${{github.workspace}}/build/artifacts/*.* | |
| name: ${{ runner.os }} | |
| release-draft: | |
| runs-on: ubuntu-latest | |
| permissions: write-all | |
| if: github.event_name != 'pull_request' | |
| needs: [ build-desktop ] | |
| name: "Release draft" | |
| steps: | |
| - name: Fetch sources | |
| uses: actions/checkout@v4 | |
| - name: Extract version | |
| run: | | |
| VERSION=$(grep -Po '[0-9\.]+(?= # CI_PROJECT_VERSION)' CMakeLists.txt) | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| echo "VERSION = $VERSION" | |
| # Remove old release drafts | |
| - name: Remove Old Release Drafts | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh api repos/{owner}/{repo}/releases \ | |
| --jq '.[] | select(.draft == true) | .id' \ | |
| | xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{} | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: 'true' | |
| - name: Create Release Draft | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release create "v${{ env.VERSION }}" \ | |
| --draft \ | |
| --title "v${{ env.VERSION }}" \ | |
| --target $GITHUB_SHA \ | |
| artifacts/*.* |