Skip to content

Commit

Permalink
Merge pull request #2 from flochre/release-via-ci
Browse files Browse the repository at this point in the history
Release via ci
  • Loading branch information
flochre authored Aug 30, 2023
2 parents f57f19a + 28c5f7e commit 8b28b89
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 25 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,20 @@ sudo chown -R $(id -u):$(id -g) out

echo "Before compression:"
ls -lh out/
cd out

for img in out/*.img; do
echo " Shrimping $img"
sudo pishrink $img
done

echo "After PiShrink:"
ls -lh out/

for img in out/*.img; do
echo " Compressing $img"
# xz -9 $img
xz --extreme --threads=0 -9 $img
done

echo "After compression:"
pigz *.img
ls -lh .
ls -lh out/
22 changes: 7 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
check-changes: ${{ steps.filter.outputs.check-changes }}
steps:
# For pull requests it's not necessary to checkout the code
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
Expand All @@ -24,30 +24,22 @@ jobs:
- '.github/workflows/setup-dependencies.sh'
- '.github/workflows/build.yml'
build-focal:
needs: changes
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.check-changes == 'true' }}
steps:
- uses: actions/checkout@v2

- name: Setup build dependencies
run: .github/workflows/setup-dependencies.sh

- name: Build image
run: .github/workflows/build.sh focal-rt-ros2

build-jammy:
needs: changes
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.check-changes == 'true' }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup build dependencies
run: .github/workflows/setup-dependencies.sh

- name: Build image
run: .github/workflows/build.sh jammy-rt-ros2

- uses: actions/upload-artifact@v3
with:
name: img-file-jammy
path: out/*.img.xz

# TODO: release image
6 changes: 5 additions & 1 deletion .github/workflows/setup-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ set -xe

export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install -y parted pv rsync wget systemd-container qemu-user-static make zip xz-utils
sudo apt-get install -y parted pv rsync wget systemd-container qemu-user-static make zip xz-utils

wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh
chmod +x pishrink.sh
sudo mv pishrink.sh /usr/local/bin/pishrink
6 changes: 4 additions & 2 deletions image_builder/data/jammy-rt-rolling-ruediger/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
# comprehensive example.
[build]
# The image url to download and customize.
image_url = https://github.com/ros-realtime/ros-realtime-rpi4-image/releases/download/22.04.3_v5.15.98-rt62-raspi_ros2_rolling/ubuntu-22.04.3-rt-ros2-arm64+raspi.img.xz
; image_url = https://github.com/flochre/ros-realtime-rpi4-image/releases/download/ruediger-offline-v1.0-rc3/ubuntu-22.04.1-rt-ruediger2-offline-v1.0-rc3-arm64+raspi.img.xz
; image_url = https://github.com/ros-realtime/ros-realtime-rpi4-image/releases/download/22.04.1_v5.15.39-rt42-raspi_ros2_humble/ubuntu-22.04.1-rt-ros2-arm64+raspi.img.xz
; image_url = https://github.com/ros-realtime/ros-realtime-rpi4-image/releases/download/22.04.1_v5.15.39-rt42-raspi_ros2_humble/ubuntu-22.04.3-rt-ros2-arm64+raspi.img.xz
; image_url = https://github.com/ros-realtime/ros-realtime-rpi4-image/releases/download/22.04.3_v5.15.39-rt42-raspi_ros2_humble/ubuntu-22.04.3-v5.15.39-rt42-arm64+raspi.img.xz
image_url = https://github.com/ros-realtime/ros-realtime-rpi4-image/releases/download/22.04.3_v5.15.98-rt62-raspi_ros2_humble/ubuntu-22.04.3-v5.15.98-rt62-arm64+raspi.img.xz

# Mount location for the partitions in the image file downloaded.
image_mounts = /boot/firmware,/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ addgroup realtime
# update the apt database and install needed packages
apt-get update \
&& apt-get upgrade -y --with-new-pkgs \
&& apt-get install -y --no-install-recommends \
&& apt-get install -y \
network-manager \
ros-$ROS_DISTRO-joy ros-$ROS_DISTRO-teleop-twist-joy \
ros-$ROS_DISTRO-teleop-twist-keyboard \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ addgroup realtime
# update the apt database and install needed packages
apt-get update \
&& apt-get upgrade -y --with-new-pkgs \
&& apt-get install -y --no-install-recommends \
&& apt-get install -y \
network-manager \
ros-$ROS_DISTRO-joy ros-$ROS_DISTRO-teleop-twist-joy \
ros-$ROS_DISTRO-teleop-twist-keyboard \
Expand Down
4 changes: 3 additions & 1 deletion image_builder/data/jammy-rt/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ image_mounts = /boot/firmware,/
image_size = 4G

# The filename of the output image
output_filename = ubuntu-22.04.3-rt-arm64+raspi.img
; output_filename = ubuntu-22.04.3-v5.15.39-rt42-arm64+raspi.img
output_filename = ubuntu-22.04.3-v5.15.98-rt62-arm64+raspi.img

# TODO: this shouldn't really be a part of the build configuration, because it
# is more like a host-level configuration. Instead of putting it here, it should
Expand All @@ -28,6 +29,7 @@ qemu_user_static_path = /usr/bin/qemu-aarch64-static
# In fact, the build scripts from this profile will only have access to
# environment variables declared for this profile.
[env]
; LINUX_RT_VERSION = 5.15.39-rt42
LINUX_RT_VERSION = 5.15.98-rt62
STOCK_LINUX_VERSION = 5.15.0-1034
PINNED_CPU_FREQUENCY = 1500000
Expand Down
2 changes: 1 addition & 1 deletion scripts/e2e_generate_iso.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ done
echo 'Compress ISO file with xz'
for iso in out/*.img; do
echo " Compressing $iso"
xz -9 $iso
xz --extreme --threads=0 -9 $iso
done

result=0
Expand Down

0 comments on commit 8b28b89

Please sign in to comment.