Skip to content

Commit a8d37ec

Browse files
committed
✨ Also update bootloader & kernel
And because of that, add a timestamp to the release tag and also include it in a new file /etc/octopiuptodate-build inside the image.
1 parent d9545d0 commit a8d37ec

File tree

4 files changed

+50
-21
lines changed

4 files changed

+50
-21
lines changed

.github/workflows/custopize.yml

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -138,37 +138,43 @@ jobs:
138138
IMAGE=$(ls *.img | head -n 1)
139139
mv $IMAGE input.img
140140
141+
- name: "📝 Prepare release"
142+
run: |
143+
RELEASE_NAME="OctoPi ${{ env.OCTOPI_VERSION }} with OctoPrint ${{ env.OCTOPRINT_VERSION }}"
144+
echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV
145+
146+
now=$(date +"%Y%m%d%H%M%S")
147+
RELEASE_TAG="${{ env.OCTOPI_VERSION }}-${{ env.OCTOPRINT_VERSION }}-$now"
148+
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
149+
150+
# release body
151+
152+
cat <<EOF > ./build/release.md
153+
154+
* OctoPi ${{ env.OCTOPI_VERSION }}
155+
* OctoPrint ${{ env.OCTOPRINT_VERSION }}
156+
* Latest kernel & bootloader
157+
158+
Created with [CustoPiZer](https://github.com/OctoPrint/CustoPiZer)
159+
EOF
160+
141161
- name: "🏗 Run CustoPiZer"
142162
uses: OctoPrint/CustoPiZer@main
143163
with:
144164
workspace: "${{ github.workspace }}/build"
145165
scripts: "${{ github.workspace }}/scripts"
146-
environment: '{ "OCTOPRINT_VERSION": "${{ env.OCTOPRINT_VERSION }}" }'
166+
environment: '{ "OCTOPRINT_VERSION": "${{ env.OCTOPRINT_VERSION }}", "RELEASE_TAG": "${{ env.RELEASE_TAG }}" }'
147167

148168
- name: "✏ Rename image"
149169
run: |
150-
OCTOPI_VERSION="${{ env.OCTOPI_VERSION }}"
151-
OCTOPRINT_VERSION="${{ env.OCTOPRINT_VERSION }}"
170+
RELEASE_TAG="${{ env.RELEASE_TAG }}"
152171
153-
IMAGE="octopi-$OCTOPI_VERSION-$OCTOPRINT_VERSION.img"
172+
IMAGE="octopi-$RELEASE_TAG.img"
154173
echo "IMAGE=$IMAGE" >> $GITHUB_ENV
155174
156175
cd build
157176
mv output.img $IMAGE
158177
159-
- name: "📝 Prepare release"
160-
run: |
161-
RELEASE_NAME="OctoPi ${{ env.OCTOPI_VERSION }} with OctoPrint ${{ env.OCTOPRINT_VERSION }}"
162-
echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV
163-
164-
RELEASE_TAG="${{ env.OCTOPI_VERSION }}.op${{ env.OCTOPRINT_VERSION }}"
165-
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
166-
167-
RELEASE_BODY=""
168-
(git rev-parse $RELEASE_TAG >/dev/null 2>&1) || RELEASE_BODY="Created with [CustoPiZer](https://github.com/OctoPrint/CustoPiZer)"
169-
170-
echo "RELEASE_BODY=$RELEASE_BODY" >> $GITHUB_ENV
171-
172178
- name: "📦 Package the image"
173179
id: package-image
174180
uses: OctoPrint/actions/package-rpi-image@main
@@ -193,7 +199,7 @@ jobs:
193199
with:
194200
name: "${{ env.RELEASE_NAME }}"
195201
tag_name: "${{ env.RELEASE_TAG }}"
196-
body: "${{ env.RELEASE_BODY }}"
202+
body_path: "build/release.md"
197203
prerelease: ${{ contains(env.OCTOPRINT_VERSION, 'rc') }}
198204
fail_on_unmatched_files: true
199205
files: |

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22

33
*The latest OctoPi release with the latest OctoPrint already included*
44

5-
This repository automatically updates the OctoPrint installation on the latest OctoPi image
5+
This repository automatically updates the OctoPrint installation, kernel and bootloader on the latest OctoPi image
66
and provides the resulting image ready to flash. Checkout the [releases](https://github.com/OctoPrint/OctoPi-UpToDate/releases).
77

88
## How does this work?
99

10-
A simple update script is run via [CustoPiZer](https://github.com/OctoPrint/CustoPiZer).
11-
All that is done is running the equivalent of `pip install -U OctoPrint==<latest version>`.
10+
A bunch of simple update scripts are run via [CustoPiZer](https://github.com/OctoPrint/CustoPiZer):
11+
12+
* `01-update-octoprint`: Updates OctoPrint to the latest version
13+
* `02-update-boot`: Updates bootloader and kernel to the latest version
14+
* `99-write-build`: Writes the build tag to `/etc/octopiuptodate-build`
1215

1316
## Can I do something like this as well?
1417

scripts/02-update-boot

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
set -x
2+
set -e
3+
4+
export LC_ALL=C
5+
6+
source /common.sh
7+
install_cleanup_trap
8+
9+
apt-get install --yes --reinstall raspberrypi-bootloader raspberrypi-kernel

scripts/99-write-build

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
set -x
2+
set -e
3+
4+
export LC_ALL=C
5+
6+
source /common.sh
7+
install_cleanup_trap
8+
9+
if [ -n "$RELEASE_TAG" ]; then
10+
echo "$RELEASE_TAG" > /etc/octopiuptodate_build
11+
fi

0 commit comments

Comments
 (0)