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] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| # Cache AUI boot directory | |
| - name: Cache AUI.BOOT deps | |
| id: cache-aui-boot | |
| uses: actions/cache@v3 | |
| env: | |
| cache-name: cache-aui-boot | |
| with: | |
| path: ~/.aui | |
| key: ${{ runner.os }}-build-${{ env.cache-name }} | |
| restore-keys: | | |
| ${{ runner.os }}-build-${{ env.cache-name }} | |
| ${{ runner.os }}-build- | |
| ${{ runner.os }}- | |
| - name: Install Linux dependencies | |
| if: matrix.os == 'ubuntu-latest' | |
| run: sudo apt-get update && sudo apt-get install pkg-config libglew-dev zlib1g-dev libssl-dev libcrypt-dev libcurl4-openssl-dev libgtk-3-dev libfontconfig-dev ninja-build libpulse-dev | |
| - name: Install macos dependencies | |
| if: matrix.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=RelWithDebInfo ${{matrix.additional_cmake_flags}} -DAUI_INSTALL_RUNTIME_DEPENDENCIES=TRUE | |
| - name: Configure CPack | |
| if: matrix.os == 'windows-latest' | |
| run: cmake -B ${{github.workspace}}/build -DCPACK_GENERATOR=INNOSETUP | |
| - name: Build project | |
| run: cmake --build ${{github.workspace}}/build --config RelWithDebInfo | |
| - name: Build AUI tests | |
| run: cmake --build ${{github.workspace}}/build --config RelWithDebInfo --target Tests | |
| - name: Run AUI tests | |
| if: matrix.os == 'windows-latest' | |
| working-directory: ${{github.workspace}}/build/bin/RelWithDebInfo/ | |
| run: ${{github.workspace}}/build/bin/RelWithDebInfo/Tests.exe | |
| - name: Run AUI tests | |
| if: matrix.os == 'ubuntu-latest' | |
| working-directory: ${{github.workspace}}/build/bin | |
| run: ${{github.workspace}}/build/bin/Tests | |
| - name: Pack | |
| working-directory: ${{github.workspace}}/build | |
| run: cpack . -CRelWithDebInfo | |
| - name: Upload | |
| if: matrix.os == 'windows-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: ${{github.workspace}}/build/*.exe | |
| name: ${{ matrix.os }} | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: write-all | |
| if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
| name: "Create release page" | |
| steps: | |
| - name: Retrieve version | |
| if: ${{ contains(github.ref, 'tags/v') }} | |
| run: | | |
| echo "TAG_NAME=${{ github.ref }} " >> $GITHUB_ENV | |
| echo "RELEASE_NAME=${{ github.ref }} " >> $GITHUB_ENV | |
| - name: Output version | |
| id: version | |
| run: | | |
| echo "ref=$TAG_NAME" >> $GITHUB_OUTPUT | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/[email protected] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ env.TAG_NAME }} | |
| release_name: ${{ env.RELEASE_NAME }} | |
| draft: false | |
| prerelease: true | |
| outputs: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| ref: ${{ steps.version.outputs.ref }} | |
| publish: | |
| name: Publish ${{ matrix.os }} | |
| runs-on: ubuntu-latest | |
| needs: [build-desktop, release] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, ubuntu-latest] | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: ./ | |
| name: ${{ matrix.os }} | |
| - id: getfilename | |
| run: echo "::set-output name=file::$(ls *)" | |
| - name: Upload to Release | |
| id: upload_to_release | |
| uses: actions/[email protected] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ needs.release.outputs.upload_url }} | |
| asset_path: ${{ steps.getfilename.outputs.file }} | |
| asset_name: ${{ steps.getfilename.outputs.file }} | |
| asset_content_type: application/x-gtar |