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 ParchLinux Docker Images | |
| on: | |
| push: | |
| branches: [ dev ] | |
| pull_request: | |
| branches: [ dev ] | |
| workflow_dispatch: | |
| jobs: | |
| build-rootfs: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: archlinux:latest | |
| strategy: | |
| matrix: | |
| image: [base, base-devel, multilib-devel] | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Install Arch Prerequisites | |
| run: | | |
| pacman -Syu --noconfirm | |
| pacman -S --noconfirm base-devel git make devtools fakeroot fakechroot sudo shadow zstd xz gzip coreutils bash sed awk grep | |
| useradd -m -s /bin/bash builder | |
| echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | |
| - name: Fix Permissions | |
| run: sudo chown -R builder:builder . | |
| - name: Build rootfs as non-root | |
| run: | | |
| sudo -u builder bash -c "make image-${{ matrix.image }}" | |
| sha256sum "output/${{ matrix.image }}.tar.zst" > "output/${{ matrix.image }}.tar.zst.SHA256" | |
| - name: Debug:List output files | |
| run: | | |
| echo "Workspace = $GITHUB_WORKSPACE" | |
| ls -R output || true | |
| - name: Upload rootfs Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: parchlinux-rootfs-${{ matrix.image }} | |
| path: | | |
| output/${{ matrix.image }}.tar.zst | |
| output/${{ matrix.image }}.tar.zst.SHA256 | |
| scripts/make-dockerfile.sh | |
| Dockerfile.template | |
| build-docker: | |
| runs-on: ubuntu-latest | |
| needs: build-rootfs | |
| strategy: | |
| matrix: | |
| image: [base, base-devel, multilib-devel] | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Download rootfs Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: parchlinux-rootfs-${{ matrix.image }} | |
| - name: Debug:List files after artifact download | |
| run: | | |
| echo "Current dir: $(pwd)" | |
| ls -R . | |
| echo "Matrix image: ${{ matrix.image }}" | |
| env | sort | |
| - name: Verify Files | |
| run: | | |
| echo "Searching for checksum file..." | |
| find . -type f -name "${{ matrix.image }}.tar.zst*" | |
| echo "=== SHA256 file content ===" | |
| cat */${{ matrix.image }}.tar.zst.SHA256 || cat ${{ matrix.image }}.tar.zst.SHA256 | |
| echo "=== Verifying checksum ===" | |
| sha256sum -c */${{ matrix.image }}.tar.zst.SHA256 || sha256sum -c ${{ matrix.image }}.tar.zst.SHA256 | |
| - name: Prepare Dockerfile | |
| run: | | |
| bash scripts/make-dockerfile.sh \ | |
| "${{ matrix.image }}.tar.zst" \ | |
| "${{ matrix.image }}" \ | |
| output "true" "Dev" | |
| - name: Debug:List output after Dockerfile generation | |
| run: | | |
| ls -R output || true | |
| - name: Build Docker Images | |
| run: | | |
| docker build --pull \ | |
| -f "output/Dockerfile.${{ matrix.image }}" \ | |
| -t "parchlinux:${{ matrix.image }}" . | |
| - name: Save Docker Images as Artifacts | |
| run: | | |
| docker save "parchlinux:${{ matrix.image }}" | zstd -o "parchlinux-${{ matrix.image }}.tar.zst" | |
| - name: Debug:Verify saved docker image file | |
| run: | | |
| ls -lh "parchlinux-${{ matrix.image }}.tar.zst" | |
| - name: Upload Docker Image Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: parchlinux-docker-${{ matrix.image }} | |
| path: parchlinux-${{ matrix.image }}.tar.zst |