Fix setting the tag on the third party module release #168
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
--- | |
# Inspired by https://github.com/qt/qtbase/blob/dev/.github/workflows/ninja-build.yml | |
# yamllint disable rule:line-length | |
name: Build Qt | |
# yamllint disable-line rule:truthy | |
on: | |
push: | |
paths: | |
- tablet_qt/tools/build_qt.py | |
- .github/scripts/change_apt_mirror.sh | |
- .github/scripts/free_up_disk_space.sh | |
- .github/scripts/install_msys_packages.ps1 | |
- .github/workflows/build-qt.yml | |
jobs: | |
build-qt: | |
strategy: | |
matrix: | |
include: | |
- name: ubuntu-20.04 | |
os: ubuntu-20.04 | |
- name: ubuntu-22.04 | |
os: ubuntu-22.04 | |
- name: windows-2019 | |
os: windows-2019 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Free up disk space | |
# The runner on Ubuntu will run out of space so we remove some of the things | |
# we don't need. | |
if: runner.os == 'Linux' | |
run: | | |
set -eux -o pipefail | |
${GITHUB_WORKSPACE}/.github/scripts/free_up_disk_space.sh | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Common Linux prerequisites | |
if: runner.os == 'Linux' | |
run: | | |
set -eux -o pipefail | |
${GITHUB_WORKSPACE}/.github/scripts/change_apt_mirror.sh | |
${GITHUB_WORKSPACE}/.github/scripts/add_apt_sources.sh | |
sudo apt-get -y install \ | |
autoconf \ | |
automake \ | |
bison \ | |
build-essential \ | |
ccache \ | |
cmake \ | |
flex \ | |
git \ | |
gperf \ | |
libass-dev \ | |
libdrm-dev \ | |
libegl1-mesa-dev \ | |
libfontconfig1-dev \ | |
libfreetype6-dev \ | |
libgnutls28-dev \ | |
libmp3lame-dev \ | |
libnss3-dev \ | |
libpulse-dev \ | |
libsdl2-dev \ | |
libtool \ | |
libva-dev \ | |
libvdpau-dev \ | |
libvorbis-dev \ | |
libx11-xcb-dev \ | |
'^libxcb.*-dev' \ | |
libxcomposite-dev \ | |
libxcursor-dev \ | |
libxdamage-dev \ | |
libxi-dev \ | |
libxkbcommon-dev \ | |
libxkbcommon-x11-dev \ | |
libxrandr-dev \ | |
libxrender-dev \ | |
meson \ | |
ninja-build \ | |
nodejs \ | |
pkg-config \ | |
texinfo \ | |
wget \ | |
yasm \ | |
zlib1g-dev | |
- name: Ubuntu 20.04 prerequisites | |
if: matrix.os == 'ubuntu-20.04' | |
run: | | |
set -eux -o pipefail | |
sudo apt-get -y build-dep qt5-default | |
sudo apt-get -y install \ | |
libasound2-dev \ | |
libcap-dev \ | |
libclang-10-dev \ | |
libclang-11-dev \ | |
libclang-12-dev \ | |
libdbus-1-dev \ | |
libevent-dev \ | |
libglu1-mesa-dev \ | |
libicu-dev \ | |
libpci-dev \ | |
libudev-dev \ | |
libxcb-glx0-dev \ | |
libxcb-xinerama0-dev \ | |
libxslt-dev \ | |
libxss-dev \ | |
libxtst-dev \ | |
libzstd-dev \ | |
perl \ | |
python \ | |
ruby | |
- name: Ubuntu 22.04 prerequisites | |
if: matrix.os == 'ubuntu-22.04' | |
run: | | |
set -eux -o pipefail | |
sudo apt-get -y install \ | |
clang \ | |
libatspi2.0-dev \ | |
libbluetooth-dev \ | |
libclang-13-dev \ | |
libclang-14-dev \ | |
libclang-15-dev \ | |
libcups2-dev \ | |
libfreetype6-dev \ | |
libhunspell-dev \ | |
libopengl-dev \ | |
libts-dev \ | |
libunwind-dev \ | |
libx11-dev \ | |
libxext-dev \ | |
libxfixes-dev \ | |
libxkbfile-dev \ | |
libxshmfence1 \ | |
libxshmfence-dev \ | |
llvm \ | |
python3 | |
- name: Windows prerequisites | |
if: matrix.os == 'windows-2019' | |
run: | | |
$ErrorActionPreference = "Stop" | |
choco install ninja nasm msys2 --yes --no-progress | |
choco install ccache --version 3.7.12 --yes --no-progress | |
# Chocolatey uses the Windows installer, which doesn't update Path | |
# https://bugzilla.nasm.us/show_bug.cgi?id=3392224 | |
echo "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
# It looks like msys2 doesn't update the Path either: | |
echo "C:\tools\msys64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
echo "C:\tools\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
# For vcvarsall.bat | |
echo "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
# Ensure Strawberry perl is first for better filename support | |
echo "C:\Strawberry\perl\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- name: Windows FFmpeg prerequisites | |
if: matrix.os == 'windows-2019' | |
run: | | |
$ErrorActionPreference = "Stop" | |
${{ github.workspace }}\.github\scripts\install_msys_packages.ps1 | |
- name: restore ccache | |
id: ccache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ runner.temp }}/ccache | |
# "github.run_id" is unique, which causes the cache to always get | |
# saved at the end of a successful run. | |
key: ccache-${{ matrix.os }}-${{ github.ref }}-${{ github.run_id }} | |
# As the unique "key" above will never be found in the cache when the | |
# job starts, we need these broader "restore-keys" in order to match | |
# and restore the most recent cache. | |
restore-keys: | | |
ccache-${{ matrix.os }}-${{ github.ref }}- | |
ccache-${{ matrix.os }}- | |
- name: configure ccache | |
run: | | |
# This must be valid in bash and PowerShell | |
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: Windows specific versions | |
if: runner.os == 'Windows' | |
run: | | |
$ErrorActionPreference = "Stop" | |
nasm --version | |
- name: print versions and environment | |
run: | | |
# This must be valid in bash and PowerShell | |
ccache --version | |
ccache --show-config | |
clang --version | |
cmake --version | |
gcc --version | |
git --version | |
ninja --version | |
perl --version | |
tar --version | |
yasm --version | |
echo Environment: | |
printenv | |
- name: Ubuntu Pip install | |
if: runner.os == 'Linux' | |
run: | | |
set -eux -o pipefail | |
python -m venv ${HOME}/venv | |
source ${HOME}/venv/bin/activate | |
python -VV | |
python -m site | |
python -m pip install -U pip | |
echo dumping pre-installed packages | |
python -m pip freeze | |
echo installing pip packages | |
python -m pip install cardinal_pythonlib | |
python -m pip install distro | |
- name: Windows Pip install | |
if: runner.os == 'Windows' | |
run: | | |
$ErrorActionPreference = "Stop" | |
cd "$env:USERPROFILE" | |
python -m venv venv | |
.\venv\Scripts\activate | |
python -VV | |
python -m site | |
python -m pip install -U pip | |
echo "dumping pre-installed packages" | |
python -m pip freeze | |
echo "installing pip packages" | |
python -m pip install cardinal_pythonlib | |
python -m pip install distro | |
- name: Ubuntu Build Qt | |
if: runner.os == 'Linux' | |
run: | | |
set -eux -o pipefail | |
echo "Free space:" | |
df -h | |
source ${HOME}/venv/bin/activate | |
export CAMCOPS_QT6_BASE_DIR=${HOME}/qt_local_build | |
cd tablet_qt/tools | |
./build_qt.py --build_linux_x86_64 | |
- name: Create tarfile | |
if: matrix.os == 'ubuntu-22.04' | |
run: | | |
set -eux -o pipefail | |
echo "Free space:" | |
df -h | |
tar -czvf /tmp/qt.tgz \ | |
${HOME}/qt_local_build/ffmpeg_linux_x86_64_build \ | |
${HOME}/qt_local_build/openssl_linux_x86_64_build \ | |
${HOME}/qt_local_build/qt_linux_x86_64_install \ | |
${HOME}/qt_local_build/sqlcipher_linux_x86_64 | |
- name: Work out tag | |
id: vars | |
run: | | |
set -eux -o pipefail | |
echo "tag=qt_${GITHUB_SHA}" >> "${GITHUB_OUTPUT}" | |
- name: Release Qt | |
if: matrix.os == 'ubuntu-22.04' | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "/tmp/qt.tgz" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
prerelease: true | |
draft: true | |
body: Qt and associated libraries for building and testing the CamCOPS app | |
name: Qt and other libraries for CamCOPS | |
tag: ${{ steps.vars.outputs.tag }} | |
- name: Windows Build Qt | |
if: runner.os == 'Windows' | |
run: | | |
$ErrorActionPreference = "Stop" | |
cd "$env:USERPROFILE" | |
.\venv\Scripts\activate | |
$env:CAMCOPS_QT6_BASE_DIR = "$env:USERPROFILE\qt_local_build" | |
cd "$env:GITHUB_WORKSPACE\tablet_qt\tools" | |
python build_qt.py --build_windows_x86_64 | |
- name: Cache stats | |
# Print ccache utilization statistics, then reset them. | |
run: | | |
# This must be valid in bash and PowerShell | |
ccache -s | |
ccache -z |