Fix documentation build for qtdeviceutilities #25
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: Build qmlls | |
on: | |
# release nightly on schedule | |
schedule: | |
- cron: '0 2 * * 1,3,5' | |
# also release nightly on manual trigger | |
workflow_dispatch: | |
# release "real" release when a qmlls tag is pushed to dev | |
push: | |
branches: | |
- 'dev' | |
tags: | |
- 'qmlls-*' | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: ubuntu | |
os: ubuntu-latest | |
deps: libgl-dev libglu-dev 'libxcb*-dev' libx11-xcb-dev libxkbcommon-x11-dev libb2-dev libdouble-conversion-dev | |
tools: ccache | |
install_cmd: sudo apt-get -y install | |
configure_flags: -xcb | |
- name: macos | |
os: macos-latest | |
deps: | |
tools: ccache | |
install_cmd: HOMEBREW_NO_INSTALL_CLEANUP=1 brew install | |
- name: windows | |
os: windows-latest | |
install_cmd: choco install | |
install_cmd_postfix: --yes --no-progress | |
tools: ccache | |
configure_flags: -no-feature-sql-psql -no-feature-sql-mysql -no-feature-sql-odbc | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: lukka/get-cmake@latest | |
- name: prepare Linux | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 | |
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100 | |
- name: prepare macOS | |
if: runner.os == 'macOS' | |
run: echo noop | |
- name: prepare Windows | |
if: runner.os == 'Windows' | |
shell: cmd | |
run: | | |
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat" | |
set >> "%GITHUB_ENV%" | |
- uses: actions/checkout@v4 | |
with: | |
path: source | |
- name: restore ccache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ runner.temp }}/ccache | |
key: ccache-${{ matrix.os }} | |
- name: install build dependencies | |
run: ${{ matrix.install_cmd }} ${{ matrix.deps }} ${{ matrix.install_cmd_postfix }} | |
if: matrix.deps != '' | |
- name: install compiler tools | |
run: ${{ matrix.install_cmd }} ${{ matrix.tools }} ${{ matrix.install_cmd_postfix }} | |
- name: configure ccache | |
run: | | |
ccache --set-config sloppiness=file_macro,time_macros | |
ccache --set-config cache_dir='${{ runner.temp }}'/ccache | |
ccache --set-config compression=true | |
ccache --set-config max_size=1G | |
- name: initialize subrepositories | |
working-directory: source | |
run: ./init-repository --module-subset=qtdeclarative --mirror="https://code.qt.io/qt/" | |
- name: set qtdeclarative to dev and set dependencies via dependencies.yaml | |
working-directory: source | |
run: cmake -DSYNC_TO_MODULE="qtdeclarative" -DSYNC_TO_BRANCH="dev" -P cmake/QtSynchronizeRepo.cmake | |
- name: configure and build | |
run: | | |
mkdir build | |
cd build | |
../source/configure -force-debug-info -ccache -no-pch -release -static \ | |
-force-bundled-libs -submodules qtdeclarative -nomake tests -nomake examples \ | |
-prefix '${{ runner.temp }}'/install_dir ${{ matrix.configure_flags }} | |
ninja qmlls | |
- name: Get current SHA | |
id: vars | |
working-directory: source/qtdeclarative | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Create info file | |
run: | | |
echo -e "commit: ${{ steps.vars.outputs.sha_short }}\nbuild: $(date +"%Y-%m-%dT%H:%M:%SZ")" \ | |
> info.txt | |
# workaround because -separate-debug-info is not supported in static builds | |
# note: msvc on windows separates the debug info, no need to strip by hand | |
- name: Stripping qmlls binary on linux | |
if: matrix.name == 'ubuntu' | |
run: | | |
objcopy --only-keep-debug ./build/qtbase/bin/qmlls ./build/qtbase/bin/qmlls.dbg | |
strip ./build/qtbase/bin/qmlls | |
objcopy --add-gnu-debuglink=./build/qtbase/bin/qmlls.dbg ./build/qtbase/bin/qmlls | |
- name: Stripping qmlls binary on mac | |
if: matrix.name == 'macos' | |
run: | | |
dsymutil ./build/qtbase/bin/qmlls -o ./build/qtbase/bin/qmlls.dSYM | |
strip ./build/qtbase/bin/qmlls | |
- name: Zip build files in archive | |
run: 7z a qmlls-${{ matrix.name }}-${{ steps.vars.outputs.sha_short }}.7z ./build/qtbase/bin/qmlls* info.txt | |
- name: Upload archive | |
uses: actions/upload-artifact@v4 | |
with: | |
path: qmlls-${{ matrix.name }}-${{ steps.vars.outputs.sha_short }}.7z | |
name: qmlls-${{ matrix.name }}-${{ steps.vars.outputs.sha_short }}.7z | |
release: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: qt/qtdeclarative | |
path: source | |
- name: Get current SHA | |
id: vars | |
working-directory: source | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Download artifacts | |
id: downloaded_artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: release | |
- name: Create nightly release | |
if: ${{ ! contains(github.ref, 'tags/qmlls-') }} | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: qmlls-nightly-${{ steps.vars.outputs.sha_short }} | |
draft: false | |
prerelease: true | |
files: release/*/*.7z | |
- name: Create release | |
if: ${{ contains(github.ref, 'tags/qmlls-') && !contains(github.ref, 'nightly') }} | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
# note: use default tag_name | |
draft: true | |
prerelease: false | |
files: release/*/*.7z |