-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
theGOTOguy
wants to merge
22
commits into
RPi-Distro:master
Choose a base branch
from
theGOTOguy:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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 270e2e4
Don't cd PiGen actually. I guess we're already there.
theGOTOguy cd910d0
Actually just checkout to root.
theGOTOguy 9658228
Try to understand why build-docker isn't found.
theGOTOguy c380657
Maybe there's just not permission to run build-docker.sh?
theGOTOguy 1d0eac7
"touch config" for a default config file.
theGOTOguy ca310aa
Add required IMG_NAME.
theGOTOguy 6809f73
Try to be more aggressive about freeing space for the build.
theGOTOguy 9aa1df5
Leave 10G on root fs.
theGOTOguy c0c14bf
Try 4096MB reserve on root instead of 10240.
theGOTOguy 34da3bd
Ok, the root-reserve has to be bigger, not smaller.
theGOTOguy 8588981
Leave 25GB in root filesystem for build.
theGOTOguy 894dcb7
OK, that failed at the image export phase with no error. Let's try 2…
theGOTOguy d90cf03
Try disabling stage5 build. We might have enough for stage4.
theGOTOguy 75fe1bd
Fix YAML.
theGOTOguy 60569dc
I guess disable Stage4 and Stage5. There isn't enough space on the G…
theGOTOguy d2f8839
Disable Stage3 builds also.
theGOTOguy b52326b
"zip", not "img".
theGOTOguy 6b2eb80
Fix up documentation and triggers.
theGOTOguy 143d3e7
Update actions/upload-artifact and actions/checkout to v4.
theGOTOguy 4b32333
Install dependenices from "depends" instead of manually.
theGOTOguy 6c69ce7
Apparently qemu-user-static is required also for this build, but is n…
theGOTOguy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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 | ||
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 }} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 intodepends
, but for now it's installed separately as part of the build step.There was a problem hiding this comment.
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.