CI: Use jurplel/install-qt-action instead of aqtinstall directly #2514
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: Build Packages | |
on: | |
push: | |
paths-ignore: | |
- 'docs/**' | |
- '**.md' | |
- 'appveyor.yml' | |
- '.travis.yml' | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
- '**.md' | |
- 'appveyor.yml' | |
- '.travis.yml' | |
env: | |
QBS_VERSION: 2.4.1 | |
SENTRY_VERSION: 0.7.13 | |
SENTRY_ORG: mapeditor | |
SENTRY_PROJECT: tiled | |
TILED_RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
TILED_SNAPSHOT: ${{ !startsWith(github.ref, 'refs/tags/v') }} | |
jobs: | |
version: | |
name: Determine Tiled version | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.get-version.outputs.version }} | |
release: ${{ steps.get-version.outputs.release }} | |
steps: | |
- name: Get version | |
id: get-version | |
run: | | |
if [[ "$TILED_RELEASE" == 'true' ]]; then echo "version=${GITHUB_REF:11}" >> $GITHUB_OUTPUT ; fi | |
if [[ "$TILED_RELEASE" != 'true' ]]; then echo "version=$(date "+%Y.%m.%d")" >> $GITHUB_OUTPUT ; fi | |
echo "release=${TILED_RELEASE}" >> $GITHUB_OUTPUT | |
linux: | |
name: Linux (AppImage, Qt ${{ matrix.qt_version_major }}) | |
runs-on: ubuntu-${{ matrix.ubuntu_version }} | |
needs: version | |
strategy: | |
matrix: | |
include: | |
- ubuntu_version: 20.04 | |
qt_version: 5.15.2 | |
qt_version_major: 5 | |
qt_arch: gcc_64 | |
qt_modules: "" | |
qbs_default_profile: x86_64-linux-gnu-gcc-10 | |
- ubuntu_version: 22.04 | |
qt_version: 6.8.1 | |
qt_version_major: 6 | |
qt_arch: linux_gcc_64 | |
qt_modules: "qtimageformats" | |
qbs_default_profile: x86_64-linux-gnu-gcc-11 | |
env: | |
TILED_VERSION: ${{ needs.version.outputs.version }} | |
QT_VERSION: ${{ matrix.qt_version }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt install \ | |
libcurl4-openssl-dev \ | |
libzstd-dev \ | |
libfuse2 | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v4 | |
with: | |
version: ${{ matrix.qt_version }} | |
arch: ${{ matrix.qt_arch }} | |
modules: ${{ matrix.qt_modules }} | |
tools: 'tools_qtcreator' | |
cache: true | |
- name: Setup ccache | |
uses: hendrikmuhs/ccache-action@v1 | |
with: | |
max-size: 250M | |
- name: Setup CMake | |
uses: jwlawson/actions-setup-cmake@v2 | |
with: | |
cmake-version: '3.19' | |
- name: Setup Qbs | |
run: | | |
qbs --version | |
qbs setup-toolchains --detect | |
qbs config defaultProfile ${{ matrix.qbs_default_profile }} | |
- name: Build Sentry Native | |
run: | | |
curl -sLO https://github.com/getsentry/sentry-native/releases/download/${SENTRY_VERSION}/sentry-native.zip | |
mkdir sentry-native | |
pushd sentry-native | |
unzip -q ../sentry-native.zip | |
cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSENTRY_BACKEND=breakpad | |
cmake --build build --parallel | |
sudo cmake --install build --prefix /usr --config RelWithDebInfo | |
popd | |
- name: Build Tiled | |
run: | | |
qbs install --install-root AppDir config:release qbs.installPrefix:/usr projects.Tiled.sentry:true qbs.debugInformation:true modules.cpp.separateDebugInformation:true modules.cpp.compilerWrapper:ccache | |
- name: Upload symbols and sources to Sentry | |
if: github.repository == 'mapeditor/tiled' && github.event_name == 'push' | |
continue-on-error: ${{ needs.version.outputs.release == 'false' }} | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
run: | | |
curl -sL https://sentry.io/get-cli/ | bash | |
sentry-cli debug-files upload --include-sources src AppDir | |
- name: Build AppImage | |
run: | | |
cp LICENSE* COPYING *md AppDir/ | |
wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" | |
wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" | |
chmod +x linuxdeploy*.AppImage | |
export EXTRA_QT_PLUGINS=svg | |
export LD_LIBRARY_PATH=${QT_ROOT_DIR}/lib:$PWD/AppDir/usr/lib | |
export OUTPUT=Tiled-${{ needs.version.outputs.version }}_Linux_Qt-${{ matrix.qt_version_major }}_x86_64.AppImage | |
# Avoid shipping the debug information | |
find AppDir -name \*.debug -delete | |
./linuxdeploy-x86_64.AppImage --appdir AppDir --custom-apprun=dist/linux/AppRun --exclude-library "*libpython3*" --plugin qt | |
# We don't need the bearer plugins (needed for Qt 5 only) | |
rm -rfv AppDir/usr/plugins/bearer | |
./linuxdeploy-x86_64.AppImage --appdir AppDir --custom-apprun=dist/linux/AppRun --exclude-library "*libpython3*" --output appimage | |
- name: Upload Tiled.AppImage | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Tiled-${{ needs.version.outputs.version }}_Linux_Qt-${{ matrix.qt_version_major }}_x86_64.AppImage | |
path: Tiled-${{ needs.version.outputs.version }}_Linux_Qt-${{ matrix.qt_version_major }}_x86_64.AppImage | |
snap: | |
name: Linux (snap) | |
runs-on: ubuntu-latest | |
needs: version | |
env: | |
TILED_VERSION: ${{ needs.version.outputs.version }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set Tiled version | |
id: version | |
run: | | |
if [[ "$TILED_RELEASE" == 'true' ]]; then echo "snap_channel=candidate" >> $GITHUB_OUTPUT ; fi | |
if [[ "$TILED_RELEASE" != 'true' ]]; then echo "snap_channel=beta" >> $GITHUB_OUTPUT ; fi | |
- name: Build snap | |
id: build | |
uses: snapcore/action-build@v1 | |
- name: Upload snap artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tiled_amd64.snap | |
path: tiled_*_amd64.snap | |
- name: Release snap (beta channel) | |
uses: snapcore/action-publish@master | |
if: github.repository == 'mapeditor/tiled' && github.event_name == 'push' && (github.ref == 'refs/heads/snapshot' || needs.version.outputs.release == 'true') | |
env: | |
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }} | |
with: | |
snap: ${{ steps.build.outputs.snap }} | |
release: ${{ steps.version.outputs.snap_channel }} | |
macos: | |
name: macOS (${{ matrix.version_suffix }}) | |
runs-on: macos-latest | |
needs: version | |
strategy: | |
matrix: | |
include: | |
- qt_version: 5.12.12 | |
qt_modules: "" | |
version_suffix: "10.12-10.15" | |
architectures: x86_64 | |
- qt_version: 6.8.1 | |
qt_modules: "qtimageformats" | |
version_suffix: "11+" | |
architectures: x86_64,arm64 | |
env: | |
TILED_VERSION: ${{ needs.version.outputs.version }} | |
QT_VERSION: ${{ matrix.qt_version }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v4 | |
with: | |
version: ${{ matrix.qt_version }} | |
arch: clang_64 | |
modules: ${{ matrix.qt_modules }} | |
setup-python: false | |
cache: true | |
- name: Setup Qbs | |
run: | | |
brew install qbs | |
qbs setup-toolchains --detect | |
qbs config defaultProfile xcode | |
- name: Build Zstandard | |
run: | | |
git clone --depth 1 -b release https://github.com/facebook/zstd.git | |
pushd zstd/lib | |
CFLAGS="-arch arm64 -arch x86_64" make libzstd.a | |
popd | |
- name: Build Tiled | |
run: | | |
qbs install --install-root install config:release qbs.architectures:${{ matrix.architectures }} qbs.installPrefix:"" projects.Tiled.staticZstd:true | |
- name: Deploy Qt | |
run: | | |
macdeployqt install/Tiled.app -verbose=2 | |
rm -f install/Tiled.app/Contents/PlugIns/tls/libqopensslbackend.dylib | |
pushd install | |
ruby ../dist/macos/fixup-install-names.rb | |
- name: Create Certificate File | |
id: certificateFile | |
if: github.repository == 'mapeditor/tiled' && github.event_name == 'push' | |
uses: timheuer/base64-to-file@v1 | |
with: | |
fileName: 'certificate.p12' | |
encodedString: ${{ secrets.MACOS_CERTIFICATE }} | |
- name: Import Certificate | |
if: github.repository == 'mapeditor/tiled' && github.event_name == 'push' | |
run: | | |
security create-keychain -p ${{ secrets.KEYCHAIN_PWD }} mapeditor/tiled | |
security default-keychain -s mapeditor/tiled | |
security unlock-keychain -p ${{ secrets.KEYCHAIN_PWD }} mapeditor/tiled | |
security -q import ${{ steps.certificateFile.outputs.filePath }} -f pkcs12 -k mapeditor/tiled -P ${{ secrets.MACOS_CERTIFICATE_PWD }} -T /usr/bin/codesign -x | |
security set-key-partition-list -S 'apple-tool:,apple:' -s -k ${{ secrets.KEYCHAIN_PWD }} mapeditor/tiled | |
- name: Sign, Notarize & Staple | |
if: github.repository == 'mapeditor/tiled' && github.event_name == 'push' | |
run: | | |
codesign --deep --force --verify --verbose --sign Lindeijer --options runtime install/Tiled.app | |
ditto -c -k --sequesterRsrc --keepParent install/Tiled.app Tiled_for_notarization.zip | |
xcrun notarytool submit --apple-id ${{ secrets.NOTARIZATION_USERNAME }} --password ${{ secrets.NOTARIZATION_PASSWORD }} --team-id ${{ secrets.NOTARIZATION_TEAM }} --wait Tiled_for_notarization.zip | |
xcrun stapler staple install/Tiled.app | |
- name: Create Archive | |
run: | | |
ditto -c -k --sequesterRsrc --keepParent install/Tiled.app Tiled-${{ needs.version.outputs.version }}_macOS-${{ matrix.version_suffix }}.zip | |
- name: Upload Tiled.app | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Tiled-${{ needs.version.outputs.version }}_macOS-${{ matrix.version_suffix }}.app | |
path: Tiled-${{ needs.version.outputs.version }}_macOS-${{ matrix.version_suffix }}.zip | |
windows: | |
name: Windows (${{ matrix.arch }}-bit, Qt ${{ matrix.qt_version_major }}) | |
runs-on: windows-latest | |
needs: version | |
strategy: | |
matrix: | |
include: | |
- qt_version: 5.15.2 | |
qt_version_major: 5 | |
qt_arch: win32_mingw81 | |
qt_modules: "" | |
arch: 32 | |
openssl_arch: x86 | |
filename_suffix: 'Windows-7-8_x86' | |
mingw_component: tools_mingw | |
mingw_variant: qt.tools.win32_mingw810 | |
mingw_dir: mingw810_32 | |
- qt_version: 6.8.1 | |
qt_version_major: 6 | |
qt_arch: win64_mingw | |
qt_modules: "qtimageformats" | |
arch: 64 | |
openssl_arch: x64 | |
filename_suffix: 'Windows-10+_x86_64' | |
mingw_component: tools_mingw1310 | |
mingw_variant: qt.tools.win64_mingw1310 | |
mingw_dir: mingw1310_64 | |
env: | |
TILED_VERSION: ${{ needs.version.outputs.version }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v4 | |
with: | |
version: ${{ matrix.qt_version }} | |
arch: ${{ matrix.qt_arch }} | |
modules: ${{ matrix.qt_modules }} | |
tools: "${{ matrix.mingw_component }},${{ matrix.mingw_variant }}" | |
cache: true | |
- name: Install Qbs | |
run: | | |
choco install -y qbs --version ${QBS_VERSION} | |
- name: Setup Qbs | |
run: | | |
qbs setup-toolchains --detect | |
qbs setup-qt ${QT_ROOT_DIR}/bin/qmake.exe qt | |
qbs config defaultProfile qt | |
- name: Build Zstandard | |
run: | | |
git clone --depth 1 -b release https://github.com/facebook/zstd.git | |
pushd zstd/lib | |
CC=gcc mingw32-make -j2 libzstd.a | |
popd | |
- name: Build Tiled | |
run: | | |
export TILED_MSI_VERSION=1.4.${GITHUB_RUN_NUMBER} | |
qbs build config:release projects.Tiled.windowsInstaller:true projects.Tiled.staticZstd:true | |
mv release/installer*/Tiled-*.msi ./Tiled-${{ needs.version.outputs.version }}_${{ matrix.filename_suffix }}.msi | |
- name: Upload Tiled installer | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Tiled-${{ needs.version.outputs.version }}_${{ matrix.filename_suffix }}.msi | |
path: Tiled-${{ needs.version.outputs.version }}_*.msi | |
- name: Upload Tiled archive | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Tiled-${{ needs.version.outputs.version }}_${{ matrix.filename_suffix }}.zip | |
path: release/install-root/* | |
github: | |
name: Upload to GitHub releases | |
runs-on: ubuntu-latest | |
needs: [version, linux, macos, windows] | |
permissions: | |
contents: write | |
if: github.repository == 'mapeditor/tiled' && github.event_name == 'push' && needs.version.outputs.release == 'true' | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
- name: Create release | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: Tiled ${{ needs.version.outputs.version }} | |
draft: true | |
prerelease: false | |
files: | | |
Tiled-${{ needs.version.outputs.version }}_Windows-10+_x86_64.msi/*.msi | |
Tiled-${{ needs.version.outputs.version }}_Windows-7-8_x86.msi/*.msi | |
Tiled-${{ needs.version.outputs.version }}_Linux_Qt-5_x86_64.AppImage/*.AppImage | |
Tiled-${{ needs.version.outputs.version }}_Linux_Qt-6_x86_64.AppImage/*.AppImage | |
Tiled-${{ needs.version.outputs.version }}_macOS-10.12-10.15.app/*.zip | |
Tiled-${{ needs.version.outputs.version }}_macOS-11+.app/*.zip | |
sentry: | |
name: Create Sentry release | |
runs-on: ubuntu-latest | |
needs: [version, linux, macos, windows] | |
if: github.repository == 'mapeditor/tiled' && github.event_name == 'push' && needs.version.outputs.release == 'true' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Create Sentry release | |
uses: getsentry/action-release@v1 | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
with: | |
environment: releases | |
version: tiled@${{ needs.version.outputs.version }} |