Skip to content

Commit feb4c65

Browse files
authored
Rpi image config (#3)
* Automate generation of rpi-image configuration file for release (test) * Update build script * Update env variables * Update download URL from generated file
1 parent 2a5d513 commit feb4c65

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

.github/workflows/custopize.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,17 @@ jobs:
7878
md5sum $IMAGE.zip > $IMAGE.zip.md5
7979
sha256sum $IMAGE.zip > $IMAGE.zip.sha256
8080
81+
ZIP_SIZE="$(du -sb $IMAGE.zip | cut -f1)"
82+
ZIP_SHA256="$(cat $IMAGE.zip.sha256 | cut -d' ' -f1)"
83+
IMAGE_SIZE="$(du -sb $IMAGE | cut -f1)"
84+
IMAGE_SHA256="$(sha256sum $IMAGE | cut -d' ' -f1)"
85+
86+
echo "ZIP_SIZE=$ZIP_SIZE" >> $GITHUB_ENV
87+
echo "ZIP_SHA256=$ZIP_SHA256" >> $GITHUB_ENV
88+
echo "IMAGE_SIZE=$IMAGE_SIZE" >> $GITHUB_ENV
89+
echo "IMAGE_SHA256=$IMAGE_SHA256" >> $GITHUB_ENV
90+
91+
8192
- name: "📝 Prepare release"
8293
run: |
8394
RELEASE_NAME="SimplyPi with OctoPrint ${{ steps.octoprint_latestrelease.outputs.release }}, SimplyPrint ${{ steps.simplyprint_version.outputs.release }} (based on OctoPi ${{ steps.octopi_latestrelease.outputs.release }})"
@@ -91,6 +102,27 @@ jobs:
91102
92103
echo "RELEASE_BODY=$RELEASE_BODY" >> $GITHUB_ENV
93104
105+
RELEASE_DATE="$(date -u +"%Y-%m-%d")"
106+
107+
cat > build/rpi-imager-simplypi.json << EOF
108+
{
109+
"os_list": [
110+
{
111+
"name": "SimplyPrint OS (aka. SimplyPi - latest)",
112+
"description": "Effortlessly manage 1, 2 or 100 3D printers from anywhere with the SimplyPrint ecosystem - free and easy to set up (SimplyPrint plugin on top of OctoPrint)",
113+
"url": "https://github.com/SimplyPrint/SimplyPi/releases/download/$RELEASE_TAG/$IMAGE.zip",
114+
"icon": "https://cdn.simplyprint.io/i/static/rpi-imager/icon_gradient.png",
115+
"extract_size": $IMAGE_SIZE,
116+
"extract_sha256": "$IMAGE_SHA256",
117+
"image_download_size": $ZIP_SIZE,
118+
"release_date": "$RELEASE_DATE",
119+
"image_download_sha256": "$ZIP_SHA256",
120+
"init_format": "systemd"
121+
}
122+
]
123+
}
124+
EOF
125+
94126
- name: "🔖 Create release & attach assets"
95127
uses: softprops/action-gh-release@v1
96128
with:
@@ -103,5 +135,6 @@ jobs:
103135
build/${{ env.IMAGE }}.zip
104136
build/${{ env.IMAGE }}.zip.md5
105137
build/${{ env.IMAGE }}.zip.sha256
138+
build/rpi-imager-simplypi.json
106139
env:
107140
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"os_list": [
3+
{
4+
"name": "SimplyPrint OS (aka. SimplyPi - latest)",
5+
"description": "Effortlessly manage 1, 2 or 100 3D printers from anywhere with the SimplyPrint ecosystem - free and easy to set up (SimplyPrint plugin on top of OctoPrint)",
6+
"url": "https://github.com/SimplyPrint/SimplyPi/releases/download/${RELEASE_TAG}/${IMAGE}",
7+
"icon": "https://cdn.simplyprint.io/i/static/rpi-imager/icon_gradient.png",
8+
"extract_size": ${IMAGE_SIZE},
9+
"extract_sha256": "${IMAGE_SHA256}",
10+
"image_download_size": ${ZIP_SIZE},
11+
"release_date": "${RELEASE_DATE}",
12+
"image_download_sha256": "${ZIP_SHA256}",
13+
"init_format": "systemd"
14+
}
15+
]
16+
}

0 commit comments

Comments
 (0)