Set-up repository to allow the Linux CI to produce AppImages (#440) #122
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: CI - Ubuntu | |
on: | |
push: | |
branches: | |
- "master" | |
tags: | |
- "v[0-9]+\\.[0-9]+\\.[0-9]+" | |
pull_request: | |
jobs: | |
ci: | |
name: Build | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v4 | |
with: | |
version: "6.8.0" | |
archives: icu qtbase qtsvg qttools | |
cache: true | |
- name: Configure CMake | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=RELEASE -DTEST=ON | |
- name: Build PokeFinder | |
run: cmake --build ${{github.workspace}}/build --config RELEASE | |
- name: Test PokeFinder | |
run: ctest --test-dir ${{github.workspace}}/build -V | |
- name: Package PokeFinder binary | |
run: | | |
mkdir upload | |
mv build/Source/PokeFinder . | |
tar czf PokeFinder-linux.tar.gz PokeFinder | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: PokeFinder-linux | |
path: PokeFinder | |
- name: Fetch AppImage tools | |
run: | | |
sudo apt install appstream | |
sudo apt install libfuse2 | |
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage | |
wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage | |
chmod a+x linuxdeploy-*.AppImage | |
- name: Build AppImage | |
run: | | |
export QMAKE=$QT_ROOT_DIR/bin/qmake | |
./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt \ | |
-e PokeFinder \ | |
-d Source/Form/io.github.admiral_fish.pokefinder.desktop \ | |
-i Source/Form/Images/Icon/pokefinder_16x16.png \ | |
-i Source/Form/Images/Icon/pokefinder_24x24.png \ | |
-i Source/Form/Images/Icon/pokefinder_32x32.png \ | |
-i Source/Form/Images/Icon/pokefinder_48x48.png \ | |
-i Source/Form/Images/Icon/pokefinder_256x256.png \ | |
--icon-filename io.github.admiral_fish.pokefinder | |
mkdir AppDir/usr/share/metainfo | |
cp Source/Form/io.github.admiral_fish.pokefinder.appdata.xml AppDir/usr/share/metainfo/ | |
./linuxdeploy-x86_64.AppImage --appdir AppDir --output appimage | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: PokeFinder-linux-appimage | |
path: PokéFinder-x86_64.AppImage | |
- name: Publish Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: PokeFinder-linux.tar.gz |