Skip to content

Commit 5e806c2

Browse files
authored
Merge pull request #673 from dbast/debug
Fix build: Building in Docker Container + update action versions
2 parents 9339bc0 + 18c13da commit 5e806c2

File tree

1 file changed

+28
-12
lines changed

1 file changed

+28
-12
lines changed

.github/workflows/build.yml

+28-12
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
target: [ "pi0", "pi2", "pi02w", "pi4" ]
3232
steps:
3333
- name: checkout seedsigner-os
34-
uses: actions/checkout@v3
34+
uses: actions/checkout@v4
3535
with:
3636
repository: "seedsigner/seedsigner-os"
3737
# use the os-ref input parameter in case of workflow_dispatch or default to main in case of cron triggers
@@ -42,7 +42,7 @@ jobs:
4242
fetch-depth: 0
4343

4444
- name: checkout source
45-
uses: actions/checkout@v3
45+
uses: actions/checkout@v4
4646
with:
4747
# ref defaults to repo default-branch=dev (cron) or SHA of event (workflow_dispatch)
4848
path: "seedsigner-os/opt/rootfs-overlay/opt"
@@ -78,7 +78,7 @@ jobs:
7878
ls -la src
7979
8080
- name: restore build cache
81-
uses: actions/cache@v3
81+
uses: actions/cache@v4
8282
# Caching reduces the build time to ~50% (currently: ~30 mins instead of ~1 hour,
8383
# while consuming ~850 MB storage space).
8484
with:
@@ -89,10 +89,25 @@ jobs:
8989
restore-keys: |
9090
build-cache-${{ matrix.target }}-
9191
92+
- name: Create build container
93+
run: |
94+
cd seedsigner-os
95+
docker build -t seedsigner-os-build .
96+
9297
- name: build
9398
run: |
94-
cd seedsigner-os/opt
95-
./build.sh --${{ matrix.target }} --skip-repo --no-clean
99+
mkdir -p \
100+
~/.buildroot-ccache \
101+
seedsigner-os/buildroot_dl
102+
docker run \
103+
--rm \
104+
-v "$(pwd)/seedsigner-os/opt:/opt" \
105+
-v "$(pwd)/seedsigner-os/images:/images" \
106+
-v "$(pwd)/seedsigner-os/buildroot_dl:/buildroot_dl" \
107+
-v "${HOME}/.buildroot-ccache:/root/.buildroot-ccache" \
108+
seedsigner-os-build \
109+
--${{ matrix.target }} --skip-repo --no-clean
110+
sudo chown -R $USER:$USER seedsigner-os/images seedsigner-os/buildroot_dl ~/.buildroot-ccache/
96111
97112
- name: list image (before rename)
98113
run: |
@@ -113,9 +128,9 @@ jobs:
113128
ls -la seedsigner-os/images
114129
115130
- name: upload images
116-
uses: actions/upload-artifact@v3
131+
uses: actions/upload-artifact@v4
117132
with:
118-
name: seedsigner_os_images
133+
name: seedsigner_os_images-${{ matrix.target }}
119134
path: "seedsigner-os/images/*.img"
120135
if-no-files-found: error
121136
# maximum 90 days retention
@@ -127,14 +142,13 @@ jobs:
127142
needs: build
128143
steps:
129144
- name: download images
130-
uses: actions/download-artifact@v3
145+
uses: actions/download-artifact@v4
131146
with:
132-
name: seedsigner_os_images
133147
path: images
134148

135149
- name: list images
136150
run: |
137-
ls -la images
151+
ls -lRa images
138152
139153
- name: get seedsigner latest commit hash
140154
id: get-seedsigner-hash
@@ -145,12 +159,14 @@ jobs:
145159
- name: write sha256sum
146160
run: |
147161
cd images
162+
# each downloaded image is in its own subfolder
163+
find . -name "*.img" -exec mv {} . \;
148164
sha256sum *.img > seedsigner_os.${{ env.source_hash }}.sha256
149165
150166
- name: upload checksums
151-
uses: actions/upload-artifact@v3
167+
uses: actions/upload-artifact@v4
152168
with:
153-
name: seedsigner_os_images
169+
name: seedsigner_os_images_sha256
154170
path: "images/*.sha256"
155171
if-no-files-found: error
156172
# maximum 90 days retention

0 commit comments

Comments
 (0)