diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index e8ad053..986bbb7 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -1,6 +1,7 @@ name: Ubuntu # Qt官方没有linux平台的x86包 on: + workflow_dispatch: push: paths: - '*.pro' @@ -25,6 +26,8 @@ jobs: - os: ubuntu-18.04 qt_ver: 6.2.2 qt_arch: gcc_64 + env: + targetName: HelloActions-Qt steps: - name: Install Qt uses: jurplel/install-qt-action@v2 @@ -32,7 +35,7 @@ jobs: version: ${{ matrix.qt_ver }} cached: 'false' - name: ubuntu install GL library - run: sudo apt-get install -y libglew-dev libglfw3-dev + run: sudo apt-get install -y libglew-dev libglfw3-dev qml-module-qtquick-controls qml-module-qtquick-controls2 - uses: actions/checkout@v2 with: fetch-depth: 1 @@ -40,3 +43,30 @@ jobs: run: | qmake 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: + name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}.zip + 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 diff --git a/HelloActions-Qt.svg b/HelloActions-Qt.svg new file mode 100644 index 0000000..e69de29