Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds GitHub Action to Build Raspbian Lite #786

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
425dbe5
First pass at building Raspbian.
theGOTOguy Jul 29, 2024
270e2e4
Don't cd PiGen actually. I guess we're already there.
theGOTOguy Jul 30, 2024
cd910d0
Actually just checkout to root.
theGOTOguy Jul 30, 2024
9658228
Try to understand why build-docker isn't found.
theGOTOguy Jul 30, 2024
c380657
Maybe there's just not permission to run build-docker.sh?
theGOTOguy Jul 30, 2024
1d0eac7
"touch config" for a default config file.
theGOTOguy Jul 30, 2024
ca310aa
Add required IMG_NAME.
theGOTOguy Jul 30, 2024
6809f73
Try to be more aggressive about freeing space for the build.
theGOTOguy Jul 30, 2024
9aa1df5
Leave 10G on root fs.
theGOTOguy Jul 30, 2024
c0c14bf
Try 4096MB reserve on root instead of 10240.
theGOTOguy Jul 30, 2024
34da3bd
Ok, the root-reserve has to be bigger, not smaller.
theGOTOguy Jul 30, 2024
8588981
Leave 25GB in root filesystem for build.
theGOTOguy Jul 30, 2024
894dcb7
OK, that failed at the image export phase with no error. Let's try 2…
theGOTOguy Jul 30, 2024
d90cf03
Try disabling stage5 build. We might have enough for stage4.
theGOTOguy Jul 30, 2024
75fe1bd
Fix YAML.
theGOTOguy Jul 30, 2024
60569dc
I guess disable Stage4 and Stage5. There isn't enough space on the G…
theGOTOguy Jul 30, 2024
d2f8839
Disable Stage3 builds also.
theGOTOguy Jul 31, 2024
b52326b
"zip", not "img".
theGOTOguy Jul 31, 2024
6b2eb80
Fix up documentation and triggers.
theGOTOguy Jul 31, 2024
143d3e7
Update actions/upload-artifact and actions/checkout to v4.
theGOTOguy Jul 31, 2024
4b32333
Install dependenices from "depends" instead of manually.
theGOTOguy Jul 31, 2024
6c69ce7
Apparently qemu-user-static is required also for this build, but is n…
theGOTOguy Jul 31, 2024
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
68 changes: 68 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build Image

on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Maximize Build Space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 10000
swap-size-mb: 1024
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'

- name: List Available Space
run: |
echo "Free space:"
df -h

- name: Checkout PiGen
uses: actions/checkout@v4

- name: Install Dependencies
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could reuse the declared build dependencies instead of listing them manually.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Mostly using depends now, but there was one additional needed dependency, qemu-user-static. Not sure whether the right thing is to put it into depends, but for now it's installed separately as part of the build step.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe @XECDesign can elaborate on whether this could be added to depends as well.

run: |
sudo apt update
sudo apt install -y qemu-user-static
sudo apt install -y < depends

- name: Create Config File
id: config
run: |
NOW=$(date +"%Y-%m-%d-%H%M")
IMAGE=Raspbian-${GITHUB_REF##*/}-$NOW
touch config
echo IMG_NAME=$IMAGE >> config
echo "image=$IMAGE" >> $GITHUB_OUTPUT

# At this time the GitHub runners don't have enough
# space to support building non-Lite builds.
# Remove this to build them in a future where they do!
- name: Disable Non-Lite Builds
run: |
touch ./stage5/SKIP ./stage4/SKIP ./stage3/SKIP
touch ./stage5/SKIP_IMAGES ./stage4/SKIP_IMAGES ./stage3/SKIP_IMAGES

- name: Build Image
run: |
./build-docker.sh

- name: Get Image Name
id: imagefile
run: |
cd deploy
ls
IMAGE_FILE=$(ls *.zip)
echo "imagefile=$IMAGE_FILE" >> $GITHUB_OUTPUT

# The image now exists in deploy/.
# Make the artifact available from the action.
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.config.outputs.image }}
path: deploy/${{ steps.imagefile.outputs.imagefile }}