Merge pull request #21 from michadasis/main #11
Workflow file for this run
This file contains hidden or 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: C++ CI/CD Pipeline (cppcheck + Debian Build) | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| tags: [ "v*" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| validate-and-package: | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout Source Code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Build Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential cmake \ | |
| qt6-base-dev qt6-tools-dev-tools \ | |
| libqt6widgets6 \ | |
| cppcheck \ | |
| dpkg-dev | |
| - name: Run cppcheck Static Analysis | |
| run: | | |
| cppcheck --enable=warning,style,performance,portability \ | |
| --suppress=shadowVariable \ | |
| --error-exitcode=1 \ | |
| src/ | |
| - name: Build UniBackpack | |
| run: | | |
| cmake -B build | |
| cmake --build build | |
| - name: Package as .deb | |
| run: | | |
| mkdir -p UniBackpack-deb/DEBIAN | |
| mkdir -p UniBackpack-deb/usr/bin | |
| mkdir -p UniBackpack-deb/usr/share/applications | |
| mkdir -p UniBackpack-deb/usr/share/icons/hicolor/256x256/apps | |
| cp build/UniBackpack UniBackpack-deb/usr/bin/unibackpack | |
| if [ -f resources/icons/unibackpack.png ]; then | |
| cp resources/icons/unibackpack.png \ | |
| UniBackpack-deb/usr/share/icons/hicolor/256x256/apps/unibackpack.png | |
| fi | |
| cat > UniBackpack-deb/DEBIAN/control << EOF | |
| Package: unibackpack | |
| Version: 1.0 | |
| Section: utils | |
| Priority: optional | |
| Architecture: amd64 | |
| Depends: libqt6widgets6, libqt6core6, libqt6gui6, polkitd, pkexec | |
| Maintainer: Apostolos Chalis <achalis@csd.auth.gr> | |
| Description: UniBackpack - University software installer | |
| A Qt6 application that installs essential software packages | |
| for Greek university students based on their department. | |
| EOF | |
| cat > UniBackpack-deb/usr/share/applications/unibackpack.desktop << EOF | |
| [Desktop Entry] | |
| Name=UniBackpack | |
| Comment=University software installer | |
| Exec=unibackpack | |
| Icon=unibackpack | |
| Terminal=false | |
| Type=Application | |
| Categories=Utility; | |
| EOF | |
| dpkg-deb --build UniBackpack-deb unibackpack_1.0_amd64.deb | |
| mkdir -p output_package | |
| mv unibackpack_1.0_amd64.deb output_package/ | |
| - name: Upload Package Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: unibackpack-deb | |
| path: output_package/*.deb | |
| - name: Publish .deb to GitHub Releases | |
| uses: softprops/action-gh-release@v2 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: output_package/*.deb |