Skip to content

Commit 312cba6

Browse files
rtibblesjredrejo
authored andcommitted
Update build to version img and zipfiles.
1 parent 2724a33 commit 312cba6

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

.github/workflows/build_img.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,11 @@ jobs:
7575
restore-keys: |
7676
${{ runner.OS }}-pimod-
7777
- name: Build Pi image
78-
run: |
79-
make images
80-
zip Kolibri.zip images/Kolibri.img
78+
run: make zipfile
8179
- name: Get ZIP filename
8280
id: get-zip-filename
83-
run: echo "zip-file-name=Kolibri.zip" >> $GITHUB_OUTPUT
81+
run: echo "zip-file-name=$(ls dist | grep .zip | cat)" >> $GITHUB_OUTPUT
8482
- uses: actions/upload-artifact@v4
8583
with:
8684
name: ${{ steps.get-zip-filename.outputs.zip-file-name }}
87-
path: ${{ steps.get-zip-filename.outputs.zip-file-name }}
85+
path: dist/${{ steps.get-zip-filename.outputs.zip-file-name }}

Makefile

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
.PHONY: get-deb clean-deb clean-images clean-tools clean install-dependencies
22

3+
DIST_DIR := dist
4+
35
SOURCE_FILE = images/source.xz
46
SOURCE_URL = https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-10-28/2024-10-22-raspios-bookworm-arm64-lite.img.xz
57

@@ -13,13 +15,13 @@ clean-tools:
1315
rm -rf pimod
1416

1517
clean-deb:
16-
rm -rf dist
17-
mkdir dist
18+
rm -rf $(DIST_DIR)
19+
mkdir $(DIST_DIR)
1820

1921
get-deb: clean-deb
2022
# The eval and shell commands here are evaluated when the recipe is parsed, so we put the cleanup
2123
# into a prerequisite make step, in order to ensure they happen prior to the download.
22-
$(eval DLFILE = $(shell wget --content-disposition -P dist/ "${deb}" 2>&1 | grep "Saving to: " | sed 's/Saving to: ‘//' | sed 's/’//'))
24+
$(eval DLFILE = $(shell wget --content-disposition -P $(DIST_DIR)/ "${deb}" 2>&1 | grep "Saving to: " | sed 's/Saving to: ‘//' | sed 's/’//'))
2325
$(eval DEBFILE = $(shell echo "${DLFILE}" | sed "s/\?.*//"))
2426
[ "${DLFILE}" = "${DEBFILE}" ] || mv "${DLFILE}" "${DEBFILE}"
2527

@@ -54,3 +56,13 @@ images: install-dependencies
5456
$(MAKE) images/source.img
5557
$(MAKE) images/base.img
5658
$(MAKE) images/Kolibri.img
59+
60+
zipfile: images
61+
# Get the version based on the debian file name kolibri_<version>-Xubuntu1_all.deb
62+
$(eval VERSION=$(shell ls ${DIST_DIR} | grep kolibri | sed -r 's/kolibri_(.*)-[0-9]+ubuntu1_all.deb/\1/'))
63+
# Rename the image file to include the version
64+
mv images/Kolibri.img images/kolibri-pi-image-$(VERSION).img
65+
# Zip the image file
66+
zip -j $(DIST_DIR)/kolibri-pi-image-$(VERSION).zip images/kolibri-pi-image-$(VERSION).img
67+
# Clean up the final image file
68+
rm images/kolibri-pi-image-$(VERSION).img

0 commit comments

Comments
 (0)