From 4e9c0685cbbb14ba58711c8c9ccaafc1f4700397 Mon Sep 17 00:00:00 2001 From: Youssef Fathy <32334265+0xzer0x@users.noreply.github.com> Date: Tue, 2 Jul 2024 08:23:11 +0300 Subject: [PATCH 1/2] feat: remove proposed solution section and add feature type --- .github/ISSUE_TEMPLATE/bug_report.yml | 4 +++- .github/ISSUE_TEMPLATE/feature_request.yml | 24 ++++++++++++++-------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 0dc043d5..e9040582 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,5 +1,7 @@ -name: 🐛 Bug Report +name: 🪲 Bug Report description: File a bug report +labels: + - bug body: - type: textarea id: prob-desc diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index e325bd03..c4abdbae 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,22 +1,30 @@ -name: ⭐ Feature Request +name: ✨ Feature Request description: Submit a feature request +labels: + - enhancement body: - type: markdown attributes: value: | Thanks for submitting a feature request! Please search the issue tracker to see if there is an existing issue for the feature you are requesting. - - type: textarea - id: the-feature-request + - type: dropdown + id: feature-type attributes: - label: The feature request - description: Write a clear and concise description of what the feature or problem is. + label: The type of the feature request + description: Choose a type for the feature request + multiple: false + options: + - Book + - Recitation + - Application + default: 2 validations: required: true - type: textarea - id: proposed-solution + id: the-feature-request attributes: - label: Proposed solution - description: Share how this will benefit the application and its users. + label: The feature request + description: Write a clear and concise description of what the feature or problem is. validations: required: true - type: textarea From b3409ab21687409b0705091e7543ec91e5daa38f Mon Sep 17 00:00:00 2001 From: Youssef Fathy <32334265+0xzer0x@users.noreply.github.com> Date: Tue, 6 Aug 2024 18:59:01 +0300 Subject: [PATCH 2/2] ci: merge deployment files into a single workflow --- .github/workflows/deploy.yml | 220 +++++++++++++++++++++++++++++++++++ .github/workflows/linux.yml | 112 ------------------ .github/workflows/macos.yml | 64 ---------- 3 files changed, 220 insertions(+), 176 deletions(-) create mode 100644 .github/workflows/deploy.yml delete mode 100644 .github/workflows/linux.yml delete mode 100644 .github/workflows/macos.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..430d400f --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,220 @@ +name: Deploy +on: + push: + tags: + - "v*.*.*" +env: + BUILD_TYPE: Release +jobs: + prepare: + runs-on: ubuntu-latest + outputs: + version: "${{ steps.setversion.outputs.version }}" + steps: + - name: Set application version + id: setversion + run: echo "version=$(echo "${{ github.ref_name }}" | cut -d'v' -f2)" >> "$GITHUB_OUTPUT" + + build-appimage: + needs: + - prepare + runs-on: ubuntu-latest + env: + APP_VER: "${{ needs.prepare.outputs.version }}" + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ github.ref_name }} + submodules: true + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + aqtversion: ==3.1.* + version: 6.6.* + host: linux + target: desktop + arch: gcc_64 + modules: >- + qtimageformats + qtmultimedia + qtnetworkauth + qtwaylandcompositor + + - name: Install tools + run: | + sudo apt update -y && sudo apt install wget fuse libxcb-cursor0 appstream appstream-util ninja-build -y + wget https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage + wget https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage + chmod +x linuxdeployqt-continuous-x86_64.AppImage + chmod +x appimagetool-x86_64.AppImage + + - name: Prepare AppDir + run: >- + mkdir -p QuranCompanion.AppDir/usr/{bin,share/{applications,metainfo,icons/hicolor/256x256/apps}} + + cp + ${{github.workspace}}/dist/xdg/io.github._0xzer0x.qurancompanion.desktop + QuranCompanion.AppDir/ + + cp ${{github.workspace}}/dist/xdg/logo256.png + QuranCompanion.AppDir/io.github._0xzer0x.qurancompanion.png + + cp + ${{github.workspace}}/dist/xdg/io.github._0xzer0x.qurancompanion.desktop + QuranCompanion.AppDir/usr/share/applications/ + + cp ${{github.workspace}}/dist/xdg/logo256.png + QuranCompanion.AppDir/usr/share/icons/hicolor/256x256/apps/io.github._0xzer0x.qurancompanion.png + + cp ${{github.workspace}}/dist/xdg/io.github._0xzer0x.qurancompanion.metainfo.xml + QuranCompanion.AppDir/usr/share/metainfo/io.github._0xzer0x.qurancompanion.appdata.xml + + echo -e "[Paths]\nPlugins = ../plugins\nLibraries = ../lib\nImports = + ../qml\nQml2Imports = ../qml" > QuranCompanion.AppDir/usr/bin/qt.conf + + - name: Configure + run: >- + cmake -B ${{github.workspace}}/build + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + run: "cmake --build ${{github.workspace}}/build" + + - name: Install + run: >- + cmake --install ${{github.workspace}}/build --prefix + QuranCompanion.AppDir/usr + + - name: Run linuxdeployqt + run: >- + rm + ${QT_PLUGIN_PATH}/sqldrivers/libqsqlmimer.so + ${QT_PLUGIN_PATH}/sqldrivers/libqsqlmysql.so + ${QT_PLUGIN_PATH}/sqldrivers/libqsqlodbc.so + ${QT_PLUGIN_PATH}/sqldrivers/libqsqlpsql.so + + ${{github.workspace}}/linuxdeployqt-continuous-x86_64.AppImage + QuranCompanion.AppDir/usr/bin/quran-companion + -unsupported-allow-new-glibc -qmake=$(which qmake) -no-translations + -extra-plugins=sqldrivers,iconengines,imageformats,multimedia,networkinformation,platforms,platformthemes,wayland-decoration-client,wayland-graphics-integration-client,wayland-graphics-integration-server,wayland-shell-integration,xcbglintegrations,egldeviceintegrations + -verbose=1 + + - name: Make AppImage + run: >- + ${{github.workspace}}/appimagetool-x86_64.AppImage -n QuranCompanion.AppDir + Quran_Companion-${{env.APP_VER}}-x86_64.AppImage + + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: appimage + path: "Quran_Companion-${{env.APP_VER}}-x86_64.AppImage" + retention-days: 7 + + build-dmg: + needs: + - prepare + runs-on: macos-12 + env: + APP_VER: "${{ needs.prepare.outputs.version }}" + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ github.ref_name }} + submodules: true + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + aqtversion: "==3.1.*" + version: "6.6.*" + host: "mac" + cache: true + target: "desktop" + arch: "clang_64" + modules: >- + qtimageformats + qtmultimedia + qtnetworkauth + + - name: Configure + run: >- + cmake -B ${{github.workspace}}/build + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Make DMG + run: | + [[ -f "${QT_PLUGIN_PATH}/sqldrivers/libqsqlodbc.dylib" ]] && rm -rf ${QT_PLUGIN_PATH}/sqldrivers/libqsqlodbc.dylib + [[ -f "${QT_PLUGIN_PATH}/sqldrivers/libqsqlpsql.dylib" ]] && rm -rf ${QT_PLUGIN_PATH}/sqldrivers/libqsqlpsql.dylib + [[ -f "${QT_PLUGIN_PATH}/sqldrivers/libqsqlmimer.dylib" ]] && rm -rf ${QT_PLUGIN_PATH}/sqldrivers/libqsqlmimer.dylib + [[ -d "${QT_PLUGIN_PATH}/sqldrivers/libqsqlodbc.dylib.dSYM" ]] && rm -rf ${QT_PLUGIN_PATH}/sqldrivers/libqsqlodbc.dylib.dSYM + [[ -d "${QT_PLUGIN_PATH}/sqldrivers/libqsqlpsql.dylib.dSYM" ]] && rm -rf ${QT_PLUGIN_PATH}/sqldrivers/libqsqlpsql.dylib.dSYM + [[ -d "${QT_PLUGIN_PATH}/sqldrivers/libqsqlmimer.dylib.dSYM" ]] && rm -rf ${QT_PLUGIN_PATH}/sqldrivers/libqsqlmimer.dylib.dSYM + cd "${{github.workspace}}/build" + macdeployqt quran-companion.app -dmg + mv quran-companion.dmg ${{ github.workspace }}/Quran_Companion-${{env.APP_VER}}-x86_64.dmg + + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: dmg + path: "Quran_Companion-${{env.APP_VER}}-x86_64.dmg" + retention-days: 7 + deploy: + needs: + - prepare + - build-appimage + - build-dmg + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + attestations: write + env: + APP_VER: "${{ needs.prepare.outputs.version }}" + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ github.ref_name }} + sparse-checkout: CHANGELOG.md + sparse-checkout-cone-mode: false + + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + merge-multiple: true + + - name: Verify artifacts + run: | + if [[ ! -f "Quran_Companion-${{env.APP_VER}}-x86_64.AppImage" || ! -f "Quran_Companion-${{env.APP_VER}}-x86_64.dmg" ]]; then + echo "Artifacts missing" >&2 + echo -e "ls -la:\n$(ls -la)" >&2 + exit 1 + fi + + - name: Generate attestations + uses: actions/attest-build-provenance@v1 + with: + subject-path: | + Quran_Companion-${{env.APP_VER}}-x86_64.AppImage + Quran_Companion-${{env.APP_VER}}-x86_64.dmg + + - name: Generate checksums + run: | + b2sum "Quran_Companion-${{env.APP_VER}}-x86_64.AppImage" > "Quran_Companion-${{env.APP_VER}}-x86_64.AppImage.b2sum" + b2sum "Quran_Companion-${{env.APP_VER}}-x86_64.dmg" > "Quran_Companion-${{env.APP_VER}}-x86_64.dmg.b2sum" + + - name: Release + uses: ncipollo/release-action@v1.13.0 + with: + name: "${{ github.ref_name }}" + tag: "${{ github.ref_name }}" + bodyFile: CHANGELOG.md + artifacts: "Quran_Companion-${{env.APP_VER}}-x86_64.*" diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml deleted file mode 100644 index 7cfb53d4..00000000 --- a/.github/workflows/linux.yml +++ /dev/null @@ -1,112 +0,0 @@ -name: Linux Deployment -on: - workflow_dispatch: - push: - tags: - - "v*.*.*" -env: - BUILD_TYPE: Release -jobs: - appimage: - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - submodules: true - - - name: Set APP_VER env variable - run: echo "APP_VER=$(cat ${{github.workspace}}/VERSION)" >> "$GITHUB_ENV" - - - name: Install Qt - uses: jurplel/install-qt-action@v3 - with: - aqtversion: ==3.1.* - version: 6.6.* - host: linux - target: desktop - arch: gcc_64 - modules: >- - qtimageformats - qtmultimedia - qtnetworkauth - qtwaylandcompositor - - - name: Install tools - run: > - sudo apt update -y && sudo apt install wget fuse libxcb-cursor0 appstream appstream-util ninja-build -y - - wget - https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage - - wget - https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage - - chmod +x linuxdeployqt-continuous-x86_64.AppImage - - chmod +x appimagetool-x86_64.AppImage - - - name: Prepare AppDir - run: > - mkdir -p QuranCompanion.AppDir/usr/{bin,share/{applications,metainfo,icons/hicolor/256x256/apps}} - - cp - ${{github.workspace}}/dist/xdg/io.github._0xzer0x.qurancompanion.desktop - QuranCompanion.AppDir/ - - cp ${{github.workspace}}/dist/xdg/logo256.png - QuranCompanion.AppDir/io.github._0xzer0x.qurancompanion.png - - cp - ${{github.workspace}}/dist/xdg/io.github._0xzer0x.qurancompanion.desktop - QuranCompanion.AppDir/usr/share/applications/ - - cp ${{github.workspace}}/dist/xdg/logo256.png - QuranCompanion.AppDir/usr/share/icons/hicolor/256x256/apps/io.github._0xzer0x.qurancompanion.png - - cp ${{github.workspace}}/dist/xdg/io.github._0xzer0x.qurancompanion.metainfo.xml - QuranCompanion.AppDir/usr/share/metainfo/io.github._0xzer0x.qurancompanion.appdata.xml - - echo -e "[Paths]\nPlugins = ../plugins\nLibraries = ../lib\nImports = - ../qml\nQml2Imports = ../qml" > QuranCompanion.AppDir/usr/bin/qt.conf - - - name: Configure - run: >- - cmake -B ${{github.workspace}}/build - -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - - name: Build - run: "cmake --build ${{github.workspace}}/build" - - - name: Install - run: >- - cmake --install ${{github.workspace}}/build --prefix - QuranCompanion.AppDir/usr - - - name: Run linuxdeployqt - run: > - rm ${QT_PLUGIN_PATH}/sqldrivers/libqsqlmimer.so ${QT_PLUGIN_PATH}/sqldrivers/libqsqlmysql.so ${QT_PLUGIN_PATH}/sqldrivers/libqsqlodbc.so ${QT_PLUGIN_PATH}/sqldrivers/libqsqlpsql.so - - ${{github.workspace}}/linuxdeployqt-continuous-x86_64.AppImage - QuranCompanion.AppDir/usr/bin/quran-companion - -unsupported-allow-new-glibc -qmake=$(which qmake) -no-translations - -extra-plugins=sqldrivers,iconengines,imageformats,multimedia,networkinformation,platforms,platformthemes,wayland-decoration-client,wayland-graphics-integration-client,wayland-graphics-integration-server,wayland-shell-integration,xcbglintegrations,egldeviceintegrations - -verbose=1 - - - name: Make AppImage - run: > - ${{github.workspace}}/appimagetool-x86_64.AppImage -n QuranCompanion.AppDir - Quran_Companion-${{env.APP_VER}}-x86_64.AppImage - - md5sum "Quran_Companion-${{env.APP_VER}}-x86_64.AppImage" > "Quran_Companion-${{env.APP_VER}}-x86_64.AppImage.md5" - - - name: Upload Release - uses: ncipollo/release-action@v1.13.0 - with: - allowUpdates: true - name: "v${{env.APP_VER}}" - tag: "v${{env.APP_VER}}" - bodyFile: CHANGELOG.md - artifacts: "Quran_Companion-${{env.APP_VER}}-x86_64.AppImage*" diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml deleted file mode 100644 index a56687fc..00000000 --- a/.github/workflows/macos.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: MacOS Deployment -on: - workflow_dispatch: - push: - tags: - - "v*.*.*" -env: - BUILD_TYPE: Release -jobs: - dmg: - runs-on: macos-12 - permissions: - contents: write - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - submodules: true - - - name: Set APP_VER env variable - run: echo "APP_VER=$(cat ${{github.workspace}}/VERSION)" >> "$GITHUB_ENV" - - - name: Install Qt - uses: jurplel/install-qt-action@v3 - with: - aqtversion: "==3.1.*" - version: "6.6.*" - host: "mac" - cache: true - target: "desktop" - arch: "clang_64" - modules: >- - qtimageformats - qtmultimedia - qtnetworkauth - - - name: Configure - run: >- - cmake -B ${{github.workspace}}/build - -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Build MacOS DMG - run: | - [[ -f "${QT_PLUGIN_PATH}/sqldrivers/libqsqlodbc.dylib" ]] && rm -rf ${QT_PLUGIN_PATH}/sqldrivers/libqsqlodbc.dylib - [[ -f "${QT_PLUGIN_PATH}/sqldrivers/libqsqlpsql.dylib" ]] && rm -rf ${QT_PLUGIN_PATH}/sqldrivers/libqsqlpsql.dylib - [[ -f "${QT_PLUGIN_PATH}/sqldrivers/libqsqlmimer.dylib" ]] && rm -rf ${QT_PLUGIN_PATH}/sqldrivers/libqsqlmimer.dylib - [[ -d "${QT_PLUGIN_PATH}/sqldrivers/libqsqlodbc.dylib.dSYM" ]] && rm -rf ${QT_PLUGIN_PATH}/sqldrivers/libqsqlodbc.dylib.dSYM - [[ -d "${QT_PLUGIN_PATH}/sqldrivers/libqsqlpsql.dylib.dSYM" ]] && rm -rf ${QT_PLUGIN_PATH}/sqldrivers/libqsqlpsql.dylib.dSYM - [[ -d "${QT_PLUGIN_PATH}/sqldrivers/libqsqlmimer.dylib.dSYM" ]] && rm -rf ${QT_PLUGIN_PATH}/sqldrivers/libqsqlmimer.dylib.dSYM - cd "${{github.workspace}}/build" - macdeployqt quran-companion.app -dmg - mv quran-companion.dmg Quran_Companion-${{env.APP_VER}}-x86_64.dmg - - - name: Create Release - uses: ncipollo/release-action@v1.13.0 - with: - allowUpdates: true - name: "v${{env.APP_VER}}" - tag: "v${{env.APP_VER}}" - bodyFile: CHANGELOG.md - artifacts: "${{github.workspace}}/build/Quran_Companion-${{env.APP_VER}}-x86_64.dmg"