Repository navigation
fix: install the avahi .deb non-interactively past the conffile prompt #9
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
| # Build + publish the DPEA Pi image. | |
| # Rebuilds when an image-affecting file changes on main, and on demand. | |
| # Customizes the stock Raspberry Pi OS image (see build-image.sh) on a native | |
| # arm64 runner, so the chroot's arm64 binaries run natively. Requires the 5358 | |
| # avahi .deb published by the avahi_0.8 repo's CI. | |
| name: build-dpea-pi-image | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [main] | |
| paths: | |
| - packages.txt | |
| - customize.sh | |
| - files/** | |
| - build-image.sh | |
| - .github/workflows/** | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Free disk + install tools | |
| run: | | |
| sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup | |
| df -h | |
| sudo apt-get update | |
| sudo apt-get install -y xz-utils parted e2fsprogs curl | |
| - name: Build image | |
| run: sudo -E ./build-image.sh | |
| - name: Generate Imager OS list | |
| run: | | |
| set -euo pipefail | |
| sudo chown -R "$(id -u):$(id -g)" .build # build-image.sh ran as root | |
| . .build/image-meta.env | |
| TAG="dpea-pi-$(date +%Y%m%d-%H%M)" | |
| IMG_URL="https://github.com/${GITHUB_REPOSITORY}/releases/download/${TAG}/${IMG_FILE}" | |
| # os-list.json = a Raspberry Pi Imager repo with one entry. init_format | |
| # enables the Customisation panel; the constant asset name means | |
| # .../releases/latest/download/os-list.json is a stable URL for Imager. | |
| jq -n \ | |
| --arg url "$IMG_URL" \ | |
| --arg date "$(date +%Y-%m-%d)" \ | |
| --arg sha "$EXTRACT_SHA256" \ | |
| --argjson esize "$EXTRACT_SIZE" \ | |
| --argjson dsize "$IMAGE_DOWNLOAD_SIZE" \ | |
| '{os_list: [ { | |
| name: "DPEA Pi", | |
| description: "DPEA exhibit base image (Raspberry Pi OS Trixie 64-bit + DPEA config)", | |
| url: $url, | |
| release_date: $date, | |
| init_format: "systemd", | |
| extract_size: $esize, | |
| extract_sha256: $sha, | |
| image_download_size: $dsize | |
| } ] }' > .build/os-list.json | |
| jq . .build/os-list.json > /dev/null && echo "os-list.json is valid JSON" | |
| echo "TAG=$TAG" >> "$GITHUB_ENV" | |
| echo "IMG_FILE=$IMG_FILE" >> "$GITHUB_ENV" | |
| - name: Publish latest Release | |
| if: github.event_name != 'pull_request' # publish on push + manual dispatch | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| set -euo pipefail | |
| gh release create "$TAG" ".build/${IMG_FILE}" .build/os-list.json \ | |
| --repo "$GITHUB_REPOSITORY" --title "$TAG" \ | |
| --notes "Auto-built DPEA Pi image from ${GITHUB_SHA::7}" --latest |