2023-03-08 00:12:02 +08:00
|
|
|
name: Ubuntu
|
2023-03-08 15:33:48 +08:00
|
|
|
# Qt官方没有linux平台的x86包
|
2023-03-08 00:12:02 +08:00
|
|
|
on:
|
2023-03-08 15:22:43 +08:00
|
|
|
workflow_dispatch:
|
2023-03-08 00:12:02 +08:00
|
|
|
push:
|
|
|
|
paths:
|
|
|
|
- '*.pro'
|
|
|
|
- 'src/**'
|
|
|
|
- '.github/workflows/ubuntu.yml'
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- '*.pro'
|
|
|
|
- 'src/**'
|
|
|
|
- '.github/workflows/ubuntu.yml'
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-18.04,ubuntu-20.04]
|
2023-03-24 20:44:38 +08:00
|
|
|
qt_ver: [6.4.3]
|
2023-03-08 00:12:02 +08:00
|
|
|
qt_arch: [gcc_64]
|
2023-03-24 20:44:38 +08:00
|
|
|
exclude:
|
|
|
|
# Qt6.2.2 need GLIBC_2.28, ubuntu 18.04 have not.
|
|
|
|
- os: ubuntu-18.04
|
|
|
|
qt_ver: 6.4.3
|
|
|
|
qt_arch: gcc_64
|
2023-03-08 15:22:43 +08:00
|
|
|
env:
|
|
|
|
targetName: example
|
2023-03-08 00:12:02 +08:00
|
|
|
steps:
|
|
|
|
- name: Install Qt
|
2023-03-25 10:31:12 +08:00
|
|
|
uses: jurplel/install-qt-action@v3
|
2023-03-08 00:12:02 +08:00
|
|
|
with:
|
|
|
|
version: ${{ matrix.qt_ver }}
|
|
|
|
cached: 'false'
|
2023-03-25 10:31:12 +08:00
|
|
|
modules: 'qtmultimedia qt5compat qtshadertools'
|
2023-03-08 00:12:02 +08:00
|
|
|
- name: ubuntu install GL library
|
2023-03-08 15:22:43 +08:00
|
|
|
run: sudo apt-get install -y libglew-dev libglfw3-dev qml-module-qtquick-controls qml-module-qtquick-controls2
|
2023-03-08 00:12:02 +08:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
|
|
|
- name: build ubuntu
|
|
|
|
run: |
|
|
|
|
qmake
|
2023-03-08 15:17:31 +08:00
|
|
|
make
|
|
|
|
- name: install QT linux deploy
|
|
|
|
uses: miurahr/install-linuxdeploy-action@v1
|
|
|
|
with:
|
|
|
|
plugins: qt appimage
|
|
|
|
# 打包
|
|
|
|
- name: package
|
|
|
|
run: |
|
|
|
|
# make sure Qt plugin finds QML sources so it can deploy the imported files
|
|
|
|
export QML_SOURCES_PATHS=src
|
|
|
|
# 拷贝依赖
|
|
|
|
linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=bin/release/${targetName} --appdir bin/release/
|
|
|
|
mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}.AppImage
|
|
|
|
# 上传artifacts
|
|
|
|
- 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
|
|
|
|
# tag 上传Release
|
|
|
|
- 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 }}_${{ matrix.os }}_${{ matrix.qt_ver }}.AppImage
|
|
|
|
tag: ${{ github.ref }}
|
|
|
|
overwrite: true
|