Fix Debian library names #101
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: CMake - Windows & Linux | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
build_type: [Release] | |
c_compiler: [clang, cl] | |
include: | |
- os: windows-latest | |
c_compiler: cl | |
cpp_compiler: cl | |
file: build | |
pretty: "Windows Artifact" | |
- os: ubuntu-latest | |
c_compiler: clang | |
cpp_compiler: clang++ | |
file: OpenFIRE_App-x86_64.AppImage | |
install_prefix: -DCMAKE_INSTALL_PREFIX=/usr | |
pretty: "Linux AppImage" | |
exclude: | |
- os: windows-latest | |
c_compiler: clang | |
- os: ubuntu-latest | |
c_compiler: cl | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set reusable strings | |
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. | |
id: strings | |
shell: bash | |
run: | | |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
aqtversion: '==3.1.*' | |
version: '5.15.2' | |
archives: 'qttranslations qttools qtsvg qtserialport qtbase icu' | |
- name: Configure CMake | |
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | |
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | |
run: > | |
cmake -B ${{ steps.strings.outputs.build-output-dir }} | |
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} | |
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
${{ matrix.install_prefix }} | |
-S ${{ github.workspace }} | |
- name: Build | |
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). | |
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} | |
- name: Install linuxdeploy | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
uses: miurahr/install-linuxdeploy-action@v1 | |
with: | |
plugins: qt appimage | |
- name: Setup AppImage | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
# thanks linuxdeploy for not preinstalling your dependencies :< | |
run: | | |
sudo apt install -y appstream libfuse2 | |
make install DESTDIR=AppDir | |
install -Dm755 "${{ github.workspace }}/org.TeamOpenFIRE.OpenFIREapp.desktop" "AppDir/usr/share/applications/org.TeamOpenFIRE.OpenFIREapp.desktop" | |
install -Dm755 "${{ github.workspace }}/ico/openfire.svg" "AppDir/usr/share/icons/hicolor/scalable/apps/org.TeamOpenFIRE.OpenFIREapp.svg" | |
linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --appdir AppDir | |
cp ${{ matrix.file }} ${{ github.workspace }} | |
working-directory: ${{ steps.strings.outputs.build-output-dir }} | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
# Artifact name | |
name: OpenFIREapp-${{ matrix.pretty }} # optional, default is artifact | |
# A file, directory or wildcard pattern that describes what to upload | |
path: ${{ matrix.file }} | |
- name: Download a Build Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
# Name of the artifact to download. If unspecified, all artifacts for the run are downloaded. | |
name: OpenFIREapp-${{ matrix.pretty }} # optional |