Add Orange Pi 5 line names #523
Workflow file for this run
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 driver | |
| on: | |
| push: | |
| branches: [ main ] | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: [ main ] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04-arm | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: limelight | |
| script: ./install_limelight.sh | |
| base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-07-04/2024-07-04-raspios-bookworm-arm64-lite.img.xz | |
| - name: limelight3 | |
| script: ./install_limelight3.sh | |
| base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-07-04/2024-07-04-raspios-bookworm-arm64-lite.img.xz | |
| - name: limelight3g | |
| script: ./install_limelight3g.sh | |
| base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-07-04/2024-07-04-raspios-bookworm-arm64-lite.img.xz | |
| - name: limelight4 | |
| script: ./install_limelight4.sh | |
| base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-07-04/2024-07-04-raspios-bookworm-arm64-lite.img.xz | |
| - name: raspi | |
| script: ./install_pi.sh | |
| base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-07-04/2024-07-04-raspios-bookworm-arm64-lite.img.xz | |
| - name: raspi_dev | |
| script: ./install_dev_pi.sh | |
| base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-07-04/2024-07-04-raspios-bookworm-arm64-lite.img.xz | |
| - name: snakeyes | |
| script: ./install_snakeyes.sh | |
| base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-07-04/2024-07-04-raspios-bookworm-arm64-lite.img.xz | |
| - name: luma_p1 | |
| script: ./install_luma_p1.sh | |
| base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-07-04/2024-07-04-raspios-bookworm-arm64-lite.img.xz | |
| - name: opi5 | |
| script: ./install_opi5.sh | |
| base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v2.4.0/ubuntu-24.04-preinstalled-server-arm64-orangepi-5.img.xz | |
| - name: opi5b | |
| script: ./install_opi5.sh | |
| base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v2.4.0/ubuntu-24.04-preinstalled-server-arm64-orangepi-5b.img.xz | |
| - name: opi5plus | |
| script: ./install_opi5.sh | |
| base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v2.4.0/ubuntu-24.04-preinstalled-server-arm64-orangepi-5-plus.img.xz | |
| - name: opi5pro | |
| script: ./install_opi5.sh | |
| base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v2.4.0/ubuntu-24.04-preinstalled-server-arm64-orangepi-5-pro.img.xz | |
| - name: opi5max | |
| script: ./install_opi5.sh | |
| base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v2.4.0/ubuntu-24.04-preinstalled-server-arm64-orangepi-5-max.img.xz | |
| - name: rock5c | |
| script: ./install_opi5.sh | |
| base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v2.4.0/ubuntu-24.04-preinstalled-server-arm64-rock-5c.img.xz | |
| - name: rubikpi3 | |
| script: ./install_rubikpi3.sh | |
| base_image: https://people.canonical.com/~platform/images/qualcomm-iot/rubikpi3/ubuntu-server-24.04/x01/ubuntu-24.04-preinstalled-server-arm64+rubikpi3-20250926-145.yaml | |
| root_location: "offset=569376768" | |
| shrink_image: "no" | |
| name: "Build for ${{ matrix.name }}" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Fetch tags | |
| run: git fetch --tags --force | |
| - name: Generate version file | |
| run: | | |
| # Build the final JSON object | |
| json_string=$(jq -n \ | |
| --arg date "$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \ | |
| --arg commit_sha "${GITHUB_SHA}" \ | |
| --arg commit_tag "$(git describe --tags --abbrev=0 2>/dev/null || echo "untagged")" \ | |
| --arg image_name "${{ matrix.name }}" \ | |
| --arg image_source "${{ matrix.base_image }}" \ | |
| '{build_date: $date, commit_sha: $commit_sha, commit_tag: $commit_tag, image_name: $image_name, image_source: $image_source}') | |
| echo "$json_string" | |
| echo "$json_string" > image-version.json | |
| - name: Install dependencies and build image | |
| uses: photonvision/photon-image-runner@HEAD | |
| id: install_deps | |
| with: | |
| minimum_free_mb: 2000 | |
| image_url: ${{ matrix.base_image }} | |
| root_location: ${{ matrix.root_location || 'partition=2' }} | |
| boot_partition: | |
| shrink_image: ${{ matrix.shrink_image || 'yes' }} | |
| commands: | | |
| set -e | |
| echo "Running ${{ matrix.script }}" | |
| chmod +x "${{ matrix.script }}" | |
| "./${{ matrix.script }}" | |
| echo "Running install_common.sh" | |
| chmod +x "./install_common.sh" | |
| "./install_common.sh" | |
| - name: Compress built image | |
| # Compress the standard images | |
| if: ${{ ! startsWith(matrix.name, 'rubik') }} | |
| run: | | |
| sudo mv ${{ steps.install_deps.outputs.image }} photonvision_${{ matrix.name }}.img | |
| sudo xz -T 0 -v photonvision_${{ matrix.name }}.img | |
| echo "artifact=photonvision_${{ matrix.name }}.img.xz" >> "$GITHUB_ENV" | |
| - name: Tar built image | |
| # Build the RubikPi3-specific tar file | |
| if: ${{ startsWith(matrix.name, 'rubik') }} | |
| run: | | |
| imagedir=$(dirname ${{ steps.install_deps.outputs.image }}) | |
| target=photonvision_${{ matrix.name }} | |
| tardir=${target} | |
| mkdir --parents ${tardir} | |
| echo "Contents of imagedir: ${imagedir}" | |
| ls -la ${imagedir} | |
| if ls ${imagedir}/*.tar.gz 1>/dev/null 2>&1; then | |
| sudo tar -xzf ${imagedir}/*.tar.gz -C ${tardir} --strip-components=1 | |
| fi | |
| sudo mv ${imagedir}/rawprogram*.xml ${tardir}/ 2>/dev/null || true | |
| sudo mv ${imagedir}/dtb.bin ${tardir}/ 2>/dev/null || true | |
| sudo mv ${imagedir}/*.img ${tardir}/ 2>/dev/null || true | |
| sudo find ${tardir} -mindepth 2 -type f -exec mv {} ${tardir}/ \; | |
| sudo find ${tardir} -mindepth 1 -type d -empty -delete | |
| echo "Contents of tardir: ${tardir}" | |
| ls -la ${tardir} | |
| sudo tar -I 'xz -T0' --create --file=${target}.tar.xz ${tardir} --checkpoint=10000 --checkpoint-action=echo='%T' | |
| echo "Contents of tar file:" | |
| # Expenive operation (has to unzip the file), only use for debugging | |
| # echo "Contents of tar file:" | |
| # tar --list --file=${target}.tar.xz | |
| echo "artifact=${target}.tar.xz" >> "$GITHUB_ENV" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.artifact }} | |
| path: ${{ env.artifact }} | |
| if-no-files-found: error | |
| retention-days: 1 | |
| release: | |
| needs: [build] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| # Download literally every single artifact | |
| - uses: actions/download-artifact@v4.1.8 | |
| - run: find | |
| # Push to dev release and/or to a real release if tagged using semantic versioning | |
| # See https://github.com/pyTooling/Actions/tree/dev/releaser | |
| - uses: pyTooling/Actions/releaser@v1.0.5 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| tag: 'Dev' | |
| rm: true | |
| files: | | |
| **/*.xz | |
| if: github.event_name == 'push' |