[Internal_Review] Refactor: Modern GNOME inspired Aesthetic & Modular QSS#16 #14
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: Build and Release ALG App Store | |
| on: | |
| push: | |
| branches: [ "main", "devel", "qt6" ] | |
| paths: | |
| - '**.cpp' | |
| - '**.h' | |
| - 'CMakeLists.txt' | |
| - '.github/workflows/**' | |
| pull_request: | |
| branches: [ "main", "devel", "qt6" ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: archlinux:latest | |
| outputs: | |
| version: ${{ steps.get_version.outputs.version }} | |
| should_release: ${{ steps.check_release.outputs.should_release }} | |
| artifact_name: ${{ steps.artifact.outputs.name }} | |
| steps: | |
| - name: Install base dependencies | |
| run: | | |
| pacman -Syu --noconfirm | |
| pacman -S --noconfirm --needed \ | |
| base-devel \ | |
| git \ | |
| cmake \ | |
| qt6-base \ | |
| qt6-tools \ | |
| pacman \ | |
| libarchive \ | |
| curl \ | |
| pkgconf | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 # Need history to check changed files | |
| - name: Mark git directory as safe | |
| run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| - name: Extract version from CMakeLists.txt | |
| id: get_version | |
| run: | | |
| VERSION=$(grep -oP 'project\(alg-app-store VERSION \K[0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt) | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Detected version: $VERSION" | |
| - name: Check if this should trigger a release | |
| id: check_release | |
| run: | | |
| # Only release on main branch when CMakeLists.txt was modified | |
| if [[ "${{ github.ref }}" == "refs/heads/main" && "${{ github.event_name }}" == "push" ]]; then | |
| # Check if CMakeLists.txt was changed in this push | |
| if git diff --name-only HEAD~1 HEAD | grep -q "CMakeLists.txt"; then | |
| echo "should_release=true" >> $GITHUB_OUTPUT | |
| echo "Release triggered: CMakeLists.txt changed on main branch" | |
| else | |
| echo "should_release=false" >> $GITHUB_OUTPUT | |
| echo "No release: CMakeLists.txt not changed" | |
| fi | |
| else | |
| echo "should_release=false" >> $GITHUB_OUTPUT | |
| echo "No release: not on main branch or not a push event" | |
| fi | |
| - name: Configure CMake | |
| run: | | |
| mkdir -p build | |
| cd build | |
| cmake .. | |
| - name: Build | |
| run: | | |
| cd build | |
| make -j$(nproc) | |
| - name: Check build artifacts | |
| run: | | |
| ls -lh build/alg-app-store | |
| file build/alg-app-store | |
| - name: Set artifact name | |
| id: artifact | |
| run: | | |
| # Replace forward slashes with dashes to handle PR refs like "12/merge" | |
| ARTIFACT_NAME="alg-app-store-${{ github.ref_name }}-${{ steps.get_version.outputs.version }}" | |
| ARTIFACT_NAME="${ARTIFACT_NAME//\//-}" | |
| echo "name=$ARTIFACT_NAME" >> $GITHUB_OUTPUT | |
| echo "Artifact name: $ARTIFACT_NAME" | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ steps.artifact.outputs.name }} | |
| path: build/alg-app-store | |
| retention-days: 30 | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: needs.build.outputs.should_release == 'true' | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download build artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ needs.build.outputs.artifact_name }} | |
| path: ./release | |
| - name: Prepare release assets | |
| run: | | |
| chmod +x ./release/alg-app-store | |
| tar -czvf alg-app-store-${{ needs.build.outputs.version }}-linux-x86_64.tar.gz -C ./release alg-app-store | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: v${{ needs.build.outputs.version }} | |
| name: ALG App Store v${{ needs.build.outputs.version }} | |
| body: | | |
| ## ALG App Store v${{ needs.build.outputs.version }} | |
| A modern package manager GUI for Arch Linux. | |
| ### Installation | |
| ```bash | |
| tar -xzvf alg-app-store-${{ needs.build.outputs.version }}-linux-x86_64.tar.gz | |
| sudo mv alg-app-store /usr/local/bin/ | |
| ``` | |
| ### Requirements | |
| - Qt6 (Core, Gui, Widgets, Network, Concurrent) | |
| - libalpm (pacman library) | |
| - yay or paru (for AUR support) | |
| files: | | |
| alg-app-store-${{ needs.build.outputs.version }}-linux-x86_64.tar.gz | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |