Skip to content

Commit b61e82c

Browse files
committed
github: generate package_index json
1 parent a4b01f0 commit b61e82c

File tree

3 files changed

+92
-2
lines changed

3 files changed

+92
-2
lines changed

Diff for: .github/workflows/package_core.yml

+15-2
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,14 @@ jobs:
156156
needs:
157157
- package-core
158158
- test-core
159+
env:
160+
CORE_ARTIFACT: ${{ needs.package-core.outputs.CORE_ARTIFACT }}
161+
CORE_TAG: ${{ needs.package-core.outputs.CORE_TAG }}
162+
PACKAGE_INDEX_JSON: zephyr-core-${{ needs.package-core.outputs.CORE_TAG }}.json
159163
steps:
160164
- uses: actions/download-artifact@v4
161165
with:
162-
name: ${{ needs.package-core.outputs.CORE_ARTIFACT }}
166+
name: ${{ env.CORE_ARTIFACT }}
163167

164168
- name: Configure AWS credentials
165169
uses: aws-actions/configure-aws-credentials@v4
@@ -168,4 +172,13 @@ jobs:
168172
aws-region: ${{ secrets.AWS_REGION }}
169173

170174
- name: Upload artifact
171-
run: aws s3 sync ${{ needs.package-core.outputs.CORE_ARTIFACT }}.tar.bz2 s3://${{ secrets.S3_BUCKET }}
175+
run: aws s3 sync ${{ env.CORE_ARTIFACT }}.tar.bz2 s3://${{ secrets.S3_BUCKET }}
176+
177+
- name: Prepare package index snippet
178+
run: ./extra/gen_package_index_json.sh
179+
180+
- name: Archive package index snippet
181+
uses: actions/upload-artifact@v4
182+
with:
183+
name: ${{ env.PACKAGE_INDEX_JSON }}
184+
path: ${{ env.PACKAGE_INDEX_JSON }}

Diff for: extra/gen_package_index_json.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
if [ -z "$CORE_TAG" ]; then
4+
echo "This script can be used in Github CI only."
5+
exit 1
6+
fi
7+
8+
export ARTIFACT_HASH=$(sha256sum $CORE_ARTIFACT)
9+
export ARTIFACT_SIZE=$(stat -c %s $CORE_ARTIFACT)
10+
11+
envsubst < extra/zephyr-core-template.json > $PACKAGE_INDEX_JSON

Diff for: extra/zephyr-core-template.json

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"packages": [
3+
{
4+
"platforms": [
5+
{
6+
"name": "Arduino Zephyr Boards",
7+
"architecture": "zephyr",
8+
"version": "$CORE_TAG",
9+
"category": "Arduino",
10+
"url": "https://downloads.arduino.cc/cores/zephyr/${CORE_ARTIFACT}.tar.bz2",
11+
"archiveFileName": "${CORE_ARTIFACT}.tar.bz2",
12+
"checksum": "SHA-256:${ARTIFACT_HASH}",
13+
"size": "${ARTIFACT_SIZE}",
14+
"help": {
15+
"online": "https://www.arduino.cc/en/Reference/HomePage"
16+
},
17+
"boards": [
18+
{
19+
"name": "Arduino Giga"
20+
},
21+
{
22+
"name": "Arduino Nano 33 BLE"
23+
},
24+
{
25+
"name": "Arduino Portenta H7"
26+
},
27+
{
28+
"name": "Arduino Portenta C33"
29+
},
30+
{
31+
"name": "Renesas EK_RA8D1"
32+
},
33+
{
34+
"name": "NXP FRDM MCXN947"
35+
},
36+
{
37+
"name": "NXP FRDM RW612"
38+
}
39+
],
40+
"toolsDependencies": [
41+
{
42+
"packager": "zephyr",
43+
"name": "arm-zephyr-eabi",
44+
"version": "0.16.8"
45+
},
46+
{
47+
"packager": "arduino",
48+
"name": "dfu-util",
49+
"version": "0.11.0-arduino5"
50+
},
51+
{
52+
"packager": "arduino",
53+
"name": "bossac",
54+
"version": "1.9.1-arduino2"
55+
},
56+
{
57+
"packager": "arduino",
58+
"name": "zephyr-post-build-tool",
59+
"version": "0.1.0"
60+
}
61+
]
62+
}
63+
]
64+
}
65+
]
66+
}

0 commit comments

Comments
 (0)