Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 43 additions & 66 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,87 +12,57 @@ concurrency:
cancel-in-progress: true

jobs:
rubik:
env:
script: "./tmp/build/install_rubikpi3.sh"
base_image: "https://people.canonical.com/~platform/images/qualcomm-iot/rubikpi3/ubuntu-server-24.04/x00/ubuntu-24.04-preinstalled-server-arm64+rubikpi3-20250912-127.yaml"

runs-on: ubuntu-24.04

name: "Build for RubikPi3"

steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Fetch tags
run: git fetch --tags --force

- name: Build rubikpi3 with mounting
run: |
chmod +x ./mount_rubikpi3.sh
./mount_rubikpi3.sh ${{ env.base_image }} ${{ env.script }} ${{ github.ref_name }}

- name: Compress built image
run: |
tar -I 'xz -T0' -cf photonvision_rubikpi3.tar.xz photonvision_rubikpi3 --checkpoint=10000 --checkpoint-action=echo='%T'

- uses: actions/[email protected]
with:
name: photonvision_rubikpi3.tar.xz
path: photonvision_rubikpi3.tar.xz
if-no-files-found: error
retention-days: 1

build:
runs-on: ubuntu-24.04

runs-on: ubuntu-24.04-arm
strategy:
fail-fast: false
matrix:
include:
- name: limelight
script: ./install_limelight.sh
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
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
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
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
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
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
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
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
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
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
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
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
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/x00/ubuntu-24.04-preinstalled-server-arm64+rubikpi3-20250912-127.yaml"

name: "Build for ${{ matrix.name }}"

Expand All @@ -103,34 +73,42 @@ jobs:
- name: Fetch tags
run: git fetch --tags --force

- uses: pguyot/arm-runner-action@HEAD
id: install_deps
with:
image_additional_mb: 1500
bind_mount_repository: true
base_image: ${{ matrix.base_image }}
commands: |
chmod +x ${{matrix.script}}
${{ matrix.script }}
chmod +x ./install_common.sh
./install_common.sh
mkdir -p /opt/photonvision/
echo "${{ github.ref_name }};${{ matrix.name }}" > /opt/photonvision/image-version
- name: Install dependencies and build image
run: |
chmod +x mount.sh
./mount.sh ${{ matrix.base_image }} ${{ matrix.script}} install_common.sh ${{ github.ref_name }} ${{ matrix.name }}

- name: Compress built image
run: |
mv ${{ steps.install_deps.outputs.image }} photonvision_${{ matrix.name }}.img
sudo xz -T 0 -v photonvision_${{ matrix.name }}.img
NAME=photonvision_${{ matrix.name }}
if [[ "${{ matrix.name }}" == rubik* ]]; then
TARGET="$NAME"
tar -I 'xz -T0' -cf photonvision_rubikpi3.tar.xz photonvision_rubikpi3 --checkpoint=10000 --checkpoint-action=echo='%T'
else
TARGET="${NAME}.img"
mv "${{ env.FINAL_IMAGE }}" "$TARGET"
sudo xz -T 0 -v "$TARGET"
fi

- uses: actions/[email protected]
if: ${{ matrix.name == 'rubikpi3' }}
with:
name: "photonvision_${{ matrix.name }}.tar.xz"
path: photonvision_${{ matrix.name }}.*.xz
if-no-files-found: error
retention-days: 1

- uses: actions/[email protected]
if: ${{ matrix.name != 'rubikpi3' }}
with:
name: photonvision_${{ matrix.name }}.img.xz
path: photonvision_${{ matrix.name }}.img.xz
name: "photonvision_${{ matrix.name }}.img.xz"
path: photonvision_${{ matrix.name }}.*.xz
if-no-files-found: error
retention-days: 1

release:
needs: [build, rubik]
needs: [build]
if: github.event_name == 'push'
runs-on: ubuntu-24.04
steps:
# Download literally every single artifact
Expand All @@ -145,4 +123,3 @@ jobs:
rm: true
files: |
**/*.xz
if: github.event_name == 'push'
3 changes: 2 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,10 @@ fi
DOWNLOAD_URL=$(curl -sk "$RELEASE_URL" |
grep "browser_download_url.*$ARCH_NAME.jar" |
cut -d : -f 2,3 |
tr -d '"'
tr -d '"'browser_download_url
)

echo $(curl -sk "$RELEASE_URL" | grep ".*$ARCH_NAME.jar")
if [[ -z $DOWNLOAD_URL ]] ; then
die "PhotonVision '$VERSION' is not available for $ARCH_NAME!" \
"See ./install --list-versions for a list of available versions."
Expand Down
9 changes: 8 additions & 1 deletion install_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# Verbose and exit on errors
set -ex

GITHUB_REF_NAME=$1
MATRIX_NAME=$2

# Do additional tasks that are common across all images,
# but not suitable for inclusion in install.sh
echo "Running install_common.sh"
Expand All @@ -26,6 +29,10 @@ echo "photon:vision" | chpasswd

# Add a helpful message to the logon screen
# ASCII Art generated by: https://www.asciiart.eu/image-to-ascii
cp -f ./files/issue.txt /etc/issue
cp -f /tmp/build/files/issue.txt /etc/issue
cp -f /etc/issue /etc/issue.net
sed -i 's/#Banner none/Banner \/etc\/issue.net/g' /etc/ssh/sshd_config

# Add photon version file
mkdir -p /opt/photonvision/
echo "${GITHUB_REF_NAME};${MATRIX_NAME}" > /opt/photonvision/image-version
5 changes: 4 additions & 1 deletion install_dev_pi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
# Verbose and exit on errors
set -ex
# Run normal photon installer

cd /tmp/build

chmod +x ./install.sh
./install.sh --install-nm=yes --arch=aarch64
./install.sh --install-nm=yes

# and edit boot partition
install -m 644 config.txt /boot/
Expand Down
4 changes: 3 additions & 1 deletion install_limelight.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
# Verbose and exit on errors
set -ex

cd /tmp/build

# Run normal photon installer
chmod +x ./install.sh
./install.sh --install-nm=yes --arch=aarch64
./install.sh --install-nm=yes

# edit boot partition
install -m 644 limelight/config.txt /boot/
Expand Down
2 changes: 2 additions & 0 deletions install_limelight3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Verbose and exit on errors
set -ex

cd /tmp/build

# Run the pi install script
chmod +x ./install_pi.sh
./install_pi.sh
Expand Down
2 changes: 2 additions & 0 deletions install_limelight3g.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Verbose and exit on errors
set -ex

cd /tmp/build

# Run the pi install script
chmod +x ./install_pi.sh
./install_pi.sh
Expand Down
2 changes: 2 additions & 0 deletions install_limelight4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Verbose and exit on errors
set -ex

cd /tmp/build

# Run the pi install script
chmod +x ./install_pi.sh
./install_pi.sh
Expand Down
2 changes: 2 additions & 0 deletions install_luma_p1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Verbose and exit on errors
set -ex

cd /tmp/build

# Run the pi install script
chmod +x ./install_pi.sh
./install_pi.sh
Expand Down
4 changes: 3 additions & 1 deletion install_opi5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Verbose and exit on errors
set -ex

cd /tmp/build

# Create pi/raspberry login
if id "$1" >/dev/null 2>&1; then
echo 'user found'
Expand Down Expand Up @@ -46,7 +48,7 @@ echo "Freed up $freed KiB"

# run Photonvision install script
chmod +x ./install.sh
./install.sh --install-nm=yes --arch=aarch64
./install.sh --install-nm=yes

echo "Installing additional things"
apt-get install --yes --quiet libc6 libstdc++6
Expand Down
4 changes: 3 additions & 1 deletion install_pi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
# Verbose and exit on errors
set -ex

cd /tmp/build

# Run normal photon installer
chmod +x ./install.sh
./install.sh --install-nm=yes --arch=aarch64
./install.sh --install-nm=yes

# and edit boot partition
install -m 644 config.txt /boot/
Expand Down
10 changes: 1 addition & 9 deletions install_rubikpi3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ wget -qO - https://thundercomm.s3.dualstack.ap-northeast-1.amazonaws.com/uploads

# Run normal photon installer
chmod +x ./install.sh
./install.sh --install-nm=yes --arch=aarch64
./install.sh --install-nm=yes

# Install packages from the RUBIK Pi PPA, we skip calling apt-get update here because install.sh already does that
apt-get -y install libqnn1 libsnpe1 qcom-adreno1 device-tree-compiler
Expand All @@ -56,11 +56,3 @@ apt-get clean

rm -rf /usr/share/doc
rm -rf /usr/share/locale/

echo '=== Running install_common.sh ==='
chmod +x ./install_common.sh
./install_common.sh
echo '=== Creating version file ==='
mkdir -p /opt/photonvision/
echo '{$1};rubikpi3' > /opt/photonvision/image-version
echo '=== Installation complete ==='
2 changes: 2 additions & 0 deletions install_snakeyes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Verbose and exit on errors
set -ex

cd /tmp/build

# Run the pi install script
chmod +x ./install_pi.sh
./install_pi.sh
Expand Down
Loading
Loading