Merge branch 'ci_admin' #7
Workflow file for this run
This file contains 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: Releases | |
on: | |
push: | |
tags: | |
- "*" | |
jobs: | |
release: | |
name: ${{ matrix.platforms.friendly_name }} Qt ${{ matrix.qt_version.qt_ver }} Release | |
runs-on: ${{ matrix.platforms.os }} | |
permissions: | |
contents: write | |
strategy: | |
max-parallel: 1 | |
matrix: | |
qt_version: | |
- { qt_ver: 5.15.2, mingw_arch: win64_mingw81 } | |
- { qt_ver: 6.5.3, mingw_arch: win64_mingw } | |
platforms: | |
- { os: windows-latest, generator: "NMake Makefiles", debug_postfix: d, compression: ZIP, friendly_name: MSVC } | |
- { os: windows-latest, generator: "MinGW Makefiles", debug_postfix: d, compression: ZIP, friendly_name: MinGW } | |
- { os: ubuntu-latest, generator: "Unix Makefiles", debug_postfix: d, compression: TGZ, friendly_name: Ubuntu } | |
- { os: macos-latest, generator: "Unix Makefiles", debug_postfix: _debug, compression: ZIP, friendly_name: MacOS } | |
steps: | |
- name: Install Qt | |
if: ${{ matrix.platforms.friendly_name != 'MinGW' }} | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: ${{ matrix.qt_version.qt_ver }} | |
- name: Install Qt MinGW | |
if: ${{ matrix.platforms.friendly_name == 'MinGW' }} | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: ${{ matrix.qt_version.qt_ver }} | |
arch: ${{ matrix.qt_version.mingw_arch }} | |
- name: Git Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Create Build Directory | |
run: | | |
mkdir build | |
cd build | |
mkdir shared-Debug | |
mkdir shared-Release | |
mkdir static-Debug | |
mkdir static-Release | |
- name: Set up MSVC environment | |
if: ${{ matrix.platforms.friendly_name == 'MSVC' }} | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Upgrade MinGW | |
if: ${{ matrix.platforms.friendly_name == 'MinGW' }} | |
run: | | |
choco upgrade mingw | |
- name: Install Linux Dependencies | |
if: ${{ runner.os == 'Linux' }} | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install libxcb-* | |
- name: Build Debug ${{ matrix.platforms.friendly_name }} Qt ${{ matrix.qt_version.qt_ver }} | |
if: ${{ runner.os != 'Linux' }} | |
run: | | |
cd build/shared-Debug | |
cmake -G"${{ matrix.platforms.generator }}" -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_DEBUG_POSTFIX=${{ matrix.platforms.debug_postfix }} -DCMAKE_INSTALL_PREFIX="../installed" ../../ | |
cmake --build . | |
cd ../static-Debug | |
cmake -G"${{ matrix.platforms.generator }}" -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_STATIC_LIBRARY_SUFFIX=_static -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_DEBUG_POSTFIX=${{ matrix.platforms.debug_postfix }} -DCMAKE_INSTALL_PREFIX="../installed" ../../ | |
cmake --build . | |
- name: Build Release ${{ matrix.platforms.friendly_name }} Qt ${{ matrix.qt_version.qt_ver }} | |
run: | | |
cd build/shared-Release | |
cmake -G"${{ matrix.platforms.generator }}" -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_INSTALL_PREFIX="../installed" ../../ | |
cmake --build . | |
cd ../static-Release | |
cmake -G"${{ matrix.platforms.generator }}" -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_STATIC_LIBRARY_SUFFIX=_static -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_INSTALL_PREFIX="../installed" ../../ | |
cmake --build . | |
- name: Create Package | |
run: | | |
cd build | |
cpack -G ${{ matrix.platforms.compression }} --config ../cmake/modules/package.cmake | |
- name: Publish Package to Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "build/QtModelUtilities*.*" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
allowUpdates: true | |
artifactErrorsFailBuild: true | |
draft: true | |
createdocs: | |
name: Create docs package and publish to gh-pages | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
needs: release | |
steps: | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
- name: Git Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Create Build Directory | |
run: | | |
mkdir build | |
- name: Install Linux Dependencies | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install doxygen mscgen dia graphviz -y | |
- name: Create Docs | |
run: | | |
cd build | |
cmake -G"Unix Makefiles" -DBUILD_DOCS=ON -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_ROOTINDEXPROXY=OFF -DBUILD_ROLEMASKPROXY=OFF -DBUILD_INSERTPROXY=OFF -DBUILD_MODELSERIALISATION=OFF -DBUILD_GENERICMODEL=OFF -DCMAKE_INSTALL_PREFIX="./installed" ../ | |
cmake --build . | |
cmake --build . --target install | |
7z a -tzip -y QtModelUtilities-Docs.zip ./installed/docs/* | |
- name: Publish Docs to Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "build/QtModelUtilities-Docs.zip" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
allowUpdates: true | |
artifactErrorsFailBuild: true | |
draft: true | |
- name: Upload to gh-pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./build/installed/docs/html | |
removedraft: | |
name: Remove Draft from Release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
needs: [release, createdocs] | |
steps: | |
- name: Publish Release | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
allowUpdates: true | |
draft: false |