Skip to content

Update 00-run-chroot.sh #2013

Update 00-run-chroot.sh

Update 00-run-chroot.sh #2013

Workflow file for this run

name: Image build on event
on:
push:
branches:
- "2.5-evo"
- "dev-release"
- "release"
- "experiments"
paths-ignore:
- '**.md'
- '**.asciidoc'
- '**.adoc'
- '.gitignore'
- 'LICENSE'
jobs:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: false # Don't fail all if any of the jobs is failing
matrix:
TARGET: [x20, radxa-zero3w, pi-bullseye] # <-- Add targets here!
#TARGET: [pi-bullseye, x86-lunar, rock5b, rock5a, radxa-cm3, x20, radxa-zero3w] # <-- Add targets here!
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 100
swap-size-mb: 200
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
overprovision-lvm: 'true'
- name: Setup env
run: |
echo "DT=$(date +'%Y-%m-%d_%H%M')" >> $GITHUB_ENV
echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
### ONLY THIS RELEVANT FOR BUILDING ###
- uses: actions/checkout@v3
- name: update
run: sudo apt-get update
- name: remove even more
run: |
sudo apt-get purge -y \
'^llvm-.*' \
'php.*' \
'^mongodb-.*' \
'^mysql-.*' \
azure-cli \
google-chrome-stable \
firefox \
powershell \
microsoft-edge-stable \
mono-devel
sudo apt-get autoremove -y
sudo apt-get clean
- name: dep
run: sudo apt-get install -y unzip curl git qemu qemu-user-static binfmt-support
- name: update e2fsprogs
if: matrix.TARGET == 'x86-lunar'
run: |
git clone https://github.com/tytso/e2fsprogs
cd e2fsprogs
mkdir build
cd build
../configure
make
sudo make install
- name: configure
run: sudo ./build.sh ${{ matrix.TARGET }}
# - name: debug
# run: |
# dd if=/dev/zero of=large_image.img bs=1M count=5650
# ls -a
# mkdir deploy
# mv *.img deploy/
- name: remove old image to make space
run: |
sudo rm -Rf -v ./work-jetson-nano-2gb-bionic/03-Preconfiguration/*
sudo rm -Rf -v ./work-jetson-nano-4gb-bionic/03-Preconfiguration/*
sudo rm -Rf -v ./work-pi-bullseye/03-Preconfiguration/*
sudo rm -Rf -v ./work-pi-legacy-bullseye/03-Preconfiguration/*
- name: magic
run: |
ls -a
sudo df -h
sudo mv ./deploy/*.img ./OpenHD-image-${{ matrix.TARGET }}-${{ matrix.DISTRO }}-${GITHUB_REF##*/}-${{ env.DT }}.img
echo "moved image"
sudo rm -rvf deploy*
sudo rm -rvf work*
sudo rm -Rf /usr/share/doc
sudo rm -Rf /home/linuxbrew
sudo rm -Rf /home/runner-admin
sudo rm -Rf /opt/hostedtoolcache
sudo rm -Rf /opt/microsoft
sudo rm -Rf /opt/hhvm
sudo apt autoremove -y
sudo df -h
########################################
- name: Compose release filename
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
run: echo "artifact_name=OpenHD-image-${{ matrix.TARGET }}-${{ matrix.DISTRO }}-${GITHUB_REF##*/}-${{ env.DT }}" >> $GITHUB_ENV
- name: Pack image for ${{ matrix.TARGET }}
uses: 'actions/upload-artifact@v3'
with:
name: "${{ matrix.TARGET }}"
path: |
*.img
if-no-files-found: error
# createEmmcImage:
# needs: build
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false # Don't fail all if any of the jobs is failing
# matrix:
# TARGET: [radxa-zero3w] # <-- Add targets here!
# steps:
# - name: Maximize build space
# uses: easimon/maximize-build-space@master
# with:
# root-reserve-mb: 100
# swap-size-mb: 200
# remove-dotnet: 'true'
# remove-android: 'true'
# remove-haskell: 'true'
# remove-codeql: 'true'
# remove-docker-images: 'true'
# overprovision-lvm: 'true'
# - name: dep
# run: sudo apt-get install -y unzip curl git qemu qemu-user-static binfmt-support
# - uses: actions/checkout@v3
# - uses: actions/download-artifact@v3
# with:
# name: "radxa-zero3w"
# - name: debug
# run: |
# ls -a
# touch emmc
# touch additionalFiles/emmc
# df -h
# - name: buildImage
# run: |
# ls -a
# sudo apt install -y xz-utils
# cp *.img additionalFiles/emmc.img
# cd additionalFiles
# gzip -c *.img > emmc.img.gz
# rm *.img
# cd ..
# sudo ./build.sh ${{ matrix.TARGET }}
# cd deploy
# sudo mv *.img ../OpenHD-EMMC-${{ matrix.TARGET }}-${{ matrix.DISTRO }}-${GITHUB_REF##*/}.img
# - name: Compose release filename
# # https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
# run: echo "artifact_name=OpenHD-EMMC-image-${{ matrix.TARGET }}-${{ matrix.DISTRO }}-${GITHUB_REF##*/}-${{ env.DT }}" >> $GITHUB_ENV
# - name: Pack image for ${{ matrix.TARGET }}
# uses: 'actions/upload-artifact@v3'
# with:
# name: "${{ matrix.TARGET }}"
# path: |
# *.img
# if-no-files-found: error
# upload:
# if: "github.event_name == 'push' && github.ref == 'refs/heads/release'"
# needs: build
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false # Don't fail all if any of the jobs is failing
# matrix:
# TARGET: [pi-bullseye, x86-lunar, rock5b, rock5a] # <-- Add targets here!
# steps:
# - name: debug
# run: df -h
# - uses: actions/checkout@v3
# - uses: actions/download-artifact@v3
# with:
# name: "${{ matrix.TARGET }}"
# - name: compress
# run: |
# ls -a
# mkdir OpenHD
# mv *.img OpenHD
# cd OpenHD*
# sha256sum * | cut -f 1 -d " " > ../sha256
# echo 'NAME<<EOF' >> $GITHUB_ENV
# ls -1 | sed -e 's/.img/.img.xz/g' >> $GITHUB_ENV
# echo 'EOF' >> $GITHUB_ENV
# echo 'SIZEFULL<<EOF' >> $GITHUB_ENV
# wc -c *.img | cut -f 1 -d " " >> $GITHUB_ENV
# echo 'EOF' >> $GITHUB_ENV
# xz -v7T0 *.img
# ls -a
# mv * ../
# ls -a
# - name: Upload to R2
# shell: bash
# env:
# aws_endpoint: "https://fra1.digitaloceanspaces.com"
# aws_key_id: ${{ secrets.DIGITALOCEAN_ACCESS_KEY_ID }}
# aws_secret_access_key: ${{ secrets.DIGITALOCEAN_SECRET_ACCESS_KEY }}
# aws_s3_bucket: openhd-images
# AWS_EC2_METADATA_DISABLED: true
# run: |
# aws configure set aws_access_key_id $aws_key_id
# aws configure set aws_secret_access_key $aws_secret_access_key
# aws s3 --endpoint-url $aws_endpoint cp ${{ env.NAME }} s3://$aws_s3_bucket/Downloader/temp/${{ env.NAME }}
# - name: generate variables for the ImageWriter
# run: |
# ls -a
# export NAME=$(cat last.release)
# export FILESIZE=${{ env.SIZEFULL }}
# export FILENAME=${{ env.NAME }}
# export DOWNLOADSIZE=$(wc -c *.xz | cut -f 1 -d " ")
# export SUM=$(cat sha256)
# export RELEASEDATE=$(date +%Y-%m-%d)
# echo "$NAME" >> ${{ matrix.TARGET }}.txt
# echo "$FILESIZE" >> ${{ matrix.TARGET }}.txt
# echo "$FILENAME" >> ${{ matrix.TARGET }}.txt
# echo "$DOWNLOADSIZE" >> ${{ matrix.TARGET }}.txt
# echo "$SUM" >> ${{ matrix.TARGET }}.txt
# echo "$RELEASEDATE" >> ${{ matrix.TARGET }}.txt
# wc -c *.xz | cut -f 1 -d " "
# - name: Upload text-files
# shell: bash
# env:
# aws_endpoint: "https://fra1.digitaloceanspaces.com"
# aws_key_id: ${{ secrets.DIGITALOCEAN_ACCESS_KEY_ID }}
# aws_secret_access_key: ${{ secrets.DIGITALOCEAN_SECRET_ACCESS_KEY }}
# aws_s3_bucket: openhd-images
# AWS_EC2_METADATA_DISABLED: true
# run: |
# aws configure set aws_access_key_id $aws_key_id
# aws configure set aws_secret_access_key $aws_secret_access_key
# aws s3 --endpoint-url $aws_endpoint cp ${{ matrix.TARGET }}.txt s3://$aws_s3_bucket/Downloader/temp/${{ matrix.TARGET }}.txt