Repository navigation
fix(ci): skip Pi-only package in Debian validation #13
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-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}" | |
| # init_format enables Imager's Customisation panel. | |
| 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' | |
| 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 |