Skip to content

Commit

Permalink
Update build to version img and zipfiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
rtibbles committed Nov 15, 2024
1 parent 3dc6ab2 commit 46fa09d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build_img.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,10 @@ jobs:
restore-keys: |
${{ runner.OS }}-pimod-
- name: Build Pi image
run: |
make images
zip Kolibri.zip images/Kolibri.img
run: make zipfile
- name: Get ZIP filename
id: get-zip-filename
run: echo "zip-file-name=Kolibri.zip" >> $GITHUB_OUTPUT
run: echo "zip-file-name=$(ls dist | grep .zip | cat)" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.get-zip-filename.outputs.zip-file-name }}
Expand Down
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.PHONY: get-deb clean-deb clean-images clean-tools clean install-dependencies

DIST_DIR := dist

SOURCE_FILE = images/source.xz
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

Expand All @@ -13,13 +15,13 @@ clean-tools:
rm -rf pimod

clean-deb:
rm -rf dist
mkdir dist
rm -rf $(DIST_DIR)
mkdir $(DIST_DIR)

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

Expand Down Expand Up @@ -54,3 +56,13 @@ images: install-dependencies
$(MAKE) images/source.img
$(MAKE) images/base.img
$(MAKE) images/Kolibri.img

zipfile: images
# Get the version based on the debian file name kolibri_<version>-Xubuntu1_all.deb
$(eval VERSION=$(shell ls ${DIST_DIR} | grep kolibri | sed 's/kolibri_\(.*\)-[0-9]+ubuntu1_all.deb/\1/'))
# Rename the image file to include the version
mv images/Kolibri.img images/kolibri-pi-image-$(VERSION).img
# Zip the image file
zip -j $(DIST_DIR)/kolibri-pi-image-$(VERSION).zip images/kolibri-pi-image-$(VERSION).img
# Clean up the final image file
rm images/kolibri-pi-image-$(VERSION).img

0 comments on commit 46fa09d

Please sign in to comment.