Skip to content

Commit

Permalink
Fix build: Building in Docker Container + update action versions
Browse files Browse the repository at this point in the history
  • Loading branch information
dbast committed Jan 24, 2025
1 parent 1e9caa5 commit 4be7892
Showing 1 changed file with 27 additions and 12 deletions.
39 changes: 27 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
target: [ "pi0", "pi2", "pi02w", "pi4" ]
steps:
- name: checkout seedsigner-os
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: "seedsigner/seedsigner-os"
# use the os-ref input parameter in case of workflow_dispatch or default to main in case of cron triggers
Expand All @@ -42,7 +42,7 @@ jobs:
fetch-depth: 0

- name: checkout source
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# ref defaults to repo default-branch=dev (cron) or SHA of event (workflow_dispatch)
path: "seedsigner-os/opt/rootfs-overlay/opt"
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
ls -la src
- name: restore build cache
uses: actions/cache@v3
uses: actions/cache@v4
# Caching reduces the build time to ~50% (currently: ~30 mins instead of ~1 hour,
# while consuming ~850 MB storage space).
with:
Expand All @@ -89,10 +89,25 @@ jobs:
restore-keys: |
build-cache-${{ matrix.target }}-
- name: Create build container
run: |
cd seedsigner-os
docker build -t seedsigner-os-build .
- name: build
run: |
cd seedsigner-os/opt
./build.sh --${{ matrix.target }} --skip-repo --no-clean
mkdir -p \
~/.buildroot-ccache \
seedsigner-os/buildroot_dl
docker run \
--rm \
-v "$(pwd)/seedsigner-os/opt:/opt" \
-v "$(pwd)/seedsigner-os/images:/images" \
-v "$(pwd)/seedsigner-os/buildroot_dl:/buildroot_dl" \
-v "${HOME}/.buildroot-ccache:/root/.buildroot-ccache" \
seedsigner-os-build \
--${{ matrix.target }} --skip-repo --no-clean
sudo chown -R $USER:$USER seedsigner-os/images seedsigner-os/buildroot_dl ~/.buildroot-ccache/
- name: list image (before rename)
run: |
Expand All @@ -113,9 +128,9 @@ jobs:
ls -la seedsigner-os/images
- name: upload images
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: seedsigner_os_images
name: seedsigner_os_images-${{ matrix.target }}
path: "seedsigner-os/images/*.img"
if-no-files-found: error
# maximum 90 days retention
Expand All @@ -127,9 +142,8 @@ jobs:
needs: build
steps:
- name: download images
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: seedsigner_os_images
path: images

- name: list images
Expand All @@ -145,12 +159,13 @@ jobs:
- name: write sha256sum
run: |
cd images
sha256sum *.img > seedsigner_os.${{ env.source_hash }}.sha256
# each downloaded image is in its own subfolder
find . -name "*.img" -print0 | xargs -0 cat | sha256sum | tee seedsigner_os.${{ env.source_hash }}.sha256
- name: upload checksums
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: seedsigner_os_images
name: seedsigner_os_images_sha256
path: "images/*.sha256"
if-no-files-found: error
# maximum 90 days retention
Expand Down

0 comments on commit 4be7892

Please sign in to comment.