Arch Linux Build & Test #24
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
| # .github/workflows/build-archlinux.yml | |
| name: Arch Linux Build & Test | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build on Arch Linux | |
| runs-on: ubuntu-latest | |
| container: archlinux:latest | |
| steps: | |
| # Check out the repository code | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| # Prepare the Arch Linux container for building | |
| - name: Set up build environment | |
| run: | | |
| pacman -Syu --noconfirm | |
| pacman -S --noconfirm --needed base-devel git qt6-base qt6-declarative cmake qt6-tools | |
| # Build the package using makepkg | |
| - name: Build the package | |
| run: | | |
| # Create a non-root user to run the build for security | |
| useradd -m builder | |
| chown -R builder:builder . | |
| # Switch to the builder user and run makepkg | |
| # The -s flag installs dependencies from the PKGBUILD | |
| su builder -c "cd PKGBUILD && makepkg -s --noconfirm" | |
| # Upload the compiled package as a workflow artifact | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: arch-package | |
| path: PACKAGEBUILD/*.pkg.tar.* |