FluentUI/.github/workflows/ubuntu.yml

90 lines
3.1 KiB
YAML
Raw Normal View History

2023-03-08 00:12:02 +08:00
name: Ubuntu
on:
2023-03-08 15:22:43 +08:00
workflow_dispatch:
2023-03-08 00:12:02 +08:00
push:
paths:
2023-04-27 09:38:57 +08:00
- '*.txt'
2023-03-08 00:12:02 +08:00
- 'src/**'
2023-04-27 09:38:57 +08:00
- 'example/**'
- 'scripts/**'
2023-03-08 00:12:02 +08:00
- '.github/workflows/ubuntu.yml'
pull_request:
paths:
2023-04-27 09:38:57 +08:00
- '*.txt'
2023-03-08 00:12:02 +08:00
- 'src/**'
2023-04-27 09:38:57 +08:00
- 'example/**'
- 'scripts/**'
- '.github/workflows/ubuntu.yml'
2023-03-08 00:12:02 +08:00
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
2023-03-28 21:56:36 +08:00
os: [ubuntu-20.04]
2023-06-13 22:24:22 +08:00
qt_ver: [6.5.0]
2023-03-08 00:12:02 +08:00
qt_arch: [gcc_64]
2023-03-08 15:22:43 +08:00
env:
targetName: example
2023-03-08 00:12:02 +08:00
steps:
2023-04-27 09:38:57 +08:00
- name: Check out repository
uses: actions/checkout@v3
2023-04-02 23:36:23 +08:00
with:
2023-04-27 09:38:57 +08:00
submodules: recursive
2023-03-08 00:12:02 +08:00
- name: Install Qt
2023-03-30 22:18:42 +08:00
uses: jurplel/install-qt-action@v3
2023-03-08 00:12:02 +08:00
with:
version: ${{ matrix.qt_ver }}
2023-04-02 23:36:23 +08:00
cache: ${{steps.cache-qt.outputs.cache-hit}}
2023-03-30 22:18:42 +08:00
arch: ${{ matrix.qt_arch }}
2023-03-30 23:25:48 +08:00
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
2023-04-27 09:38:57 +08:00
- name: Set up Ninja
uses: seanmiddleditch/gha-setup-ninja@v3
with:
version: 1.10.2
2023-03-08 00:12:02 +08:00
- name: ubuntu install GL library
2023-06-06 21:14:33 +08:00
run: sudo apt-get install -y libxcb-cursor0 libgl1-mesa-dev libxcb1-dev libgtk-3-dev libxkbcommon-x11-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-sync-dev libxcb-render-util0-dev libxcb-shm0-dev
2023-04-27 09:38:57 +08:00
2023-03-08 00:12:02 +08:00
- name: build ubuntu
run: |
2023-04-27 09:38:57 +08:00
ninja --version
cmake --version
mkdir build
cd build
2023-06-13 22:24:22 +08:00
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=/home/runner/work/FluentUI/Qt/6.5.0/gcc_64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
2023-04-27 09:38:57 +08:00
cmake --build . --target all --config Release --parallel
2023-03-08 15:17:31 +08:00
- name: install QT linux deploy
uses: miurahr/install-linuxdeploy-action@v1
with:
plugins: qt appimage
2023-04-27 09:38:57 +08:00
2023-04-02 23:36:23 +08:00
- name: Check if svg file exists
run: if [ ! -f "${targetName}.svg" ]; then echo "File not found, creating..."; touch ${targetName}.svg; fi
2023-04-27 09:38:57 +08:00
2023-03-08 15:17:31 +08:00
- name: package
run: |
# make sure Qt plugin finds QML sources so it can deploy the imported files
2023-04-24 21:14:08 +08:00
export QML_SOURCES_PATHS=./
2023-03-08 15:17:31 +08:00
# 拷贝依赖
2023-03-25 12:21:00 +08:00
linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=bin/release/${targetName} --appdir bin/release/
2023-03-08 15:17:31 +08:00
mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}.AppImage
2023-04-27 09:38:57 +08:00
2023-03-08 15:17:31 +08:00
- uses: actions/upload-artifact@v2
with:
2023-03-08 15:56:53 +08:00
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}
2023-03-08 15:17:31 +08:00
path: ${{ env.targetName }}.AppImage
2023-04-27 09:38:57 +08:00
2023-03-08 15:17:31 +08:00
- name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.targetName }}.AppImage
asset_name: ${{ env.targetName }}_${{ github.ref_name }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}.AppImage
2023-03-08 15:17:31 +08:00
tag: ${{ github.ref }}
overwrite: true