Skip to content

Commit 5169112

Browse files
committed
github: workflows: Add extract_size to os_list.json
- This field is now required - Also compress downloadable binaries Signed-off-by: Ayush Singh <ayush@beagleboard.org>
1 parent 8a7031a commit 5169112

2 files changed

Lines changed: 17 additions & 9 deletions

File tree

.github/workflows/cd.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ jobs:
4646
- name: Rename firmware
4747
run: |
4848
VM=$(cat modules/microblocks/gp/runtime/versions | grep VM | awk '{print $2}')
49-
mv build/zephyr/zephyr.bin microblocks_${{ matrix.board }}_${{ matrix.version }}_${VM}.bin
49+
BIN_NAME=microblocks_${{ matrix.board }}_${{ matrix.version }}_${VM}.bin
50+
mv build/zephyr/zephyr.bin $BIN_NAME
51+
xz -z $BIN_NAME
5052
5153
- name: Pre-Release
5254
uses: softprops/action-gh-release@v2
@@ -55,16 +57,18 @@ jobs:
5557
name: Continuous Release
5658
tag_name: continuous-release
5759
body: Continuous Dev and Pilot builds of MicroBlocks
58-
files: microblocks_*.bin
60+
files: microblocks_*.bin.xz
5961

6062
- name: Generate OS List
6163
run: |
6264
export VM=$(cat modules/microblocks/gp/runtime/versions | grep VM | awk '{print $2}')
63-
export URL="https://github.com/beagleboard/microblocks-zephyr/releases/download/continuous-release/microblocks_beagleconnect_freedom_dev_${VM}.bin"
64-
export SHA=$(sha256sum microblocks_${{ matrix.board }}_${{ matrix.version }}_${VM}.bin | cut -d " " -f 1)
65+
BIN_NAME=microblocks_${{ matrix.board }}_${{ matrix.version }}_${VM}.bin.xz
66+
export URL="https://github.com/beagleboard/microblocks-zephyr/releases/download/continuous-release/${BIN_NAME}"
67+
export SHA=$(sha256sum ${BIN_NAME} | cut -d " " -f 1)
6568
export RELEASE_DATE=$(date +"%Y-%m-%d")
6669
export DEVICE=$(echo ${{ matrix.board }} | sed "s/_/-/g")
67-
jq -n '[ .name = env.OS_LIST_NAME | .description = env.OS_LIST_DESC | .icon = env.OS_LIST_ICON | .devices = [ env.DEVICE ] | .tags = [ "education" ] | .url = env.URL | .image_download_sha256 = env.SHA | .release_date = env.RELEASE_DATE ]' > os_list_${{ matrix.version }}.json
70+
EXTRACT_SIZE=$(xz --robot --list ${BIN_NAME} | awk 'END {print $5}')
71+
jq -n --argjson extract_size $EXTRACT_SIZE '[ .name = env.OS_LIST_NAME | .description = env.OS_LIST_DESC | .icon = env.OS_LIST_ICON | .devices = [ env.DEVICE ] | .tags = [ "education" ] | .url = env.URL | .image_download_sha256 = env.SHA | .release_date = env.RELEASE_DATE | .extract_size = $extract_size ]' > os_list_${{ matrix.version }}.json
6872
6973
- name: OS List Generation
7074
uses: softprops/action-gh-release@v2

.github/workflows/release.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,27 @@ jobs:
4242
- name: Rename firmware
4343
run: |
4444
VM=$(cat modules/microblocks/gp/runtime/versions | grep VM | awk '{print $2}')
45-
mv build/zephyr/zephyr.bin microblocks_${{ matrix.board }}_${VM}.bin
45+
BIN_NAME=microblocks_${{ matrix.board }}_${VM}.bin
46+
mv build/zephyr/zephyr.bin $BIN_NAME
47+
xz -z $BIN_NAME
4648
4749
- name: Release
4850
uses: softprops/action-gh-release@v2
4951
with:
5052
generate_release_notes: true
51-
files: microblocks_*.bin
53+
files: microblocks_*.bin.xz
5254

5355
- name: Generate OS List
5456
run: |
5557
export VM=$(cat modules/microblocks/gp/runtime/versions | grep VM | awk '{print $2}')
58+
BIN_NAME=microblocks_${{ matrix.board }}_${VM}.bin.xz
5659
export OS_LIST_NAME="MicroBlocks VM${VM}"
5760
export URL="https://github.com/beagleboard/microblocks-zephyr/releases/download/VM${VM}/microblocks_${{ matrix.board }}_${VM}.bin"
58-
export SHA=$(sha256sum microblocks_${{ matrix.board }}_${VM}.bin | cut -d " " -f 1)
61+
export SHA=$(sha256sum ${BIN_NAME} | cut -d " " -f 1)
5962
export RELEASE_DATE=$(date +"%Y-%m-%d")
6063
export DEVICE=$(echo ${{ matrix.board }} | sed "s/_/-/g")
61-
jq -n '[ .name = env.OS_LIST_NAME | .description = env.OS_LIST_DESC | .icon = env.OS_LIST_ICON | .devices = [ env.DEVICE ] | .tags = [ "education" ] | .url = env.URL | .image_download_sha256 = env.SHA | .release_date = env.RELEASE_DATE ]' > os_list_stable.json
64+
EXTRACT_SIZE=$(xz --robot --list ${BIN_NAME} | awk 'END {print $5}')
65+
jq -n --argjson extract_size $EXTRACT_SIZE '[ .name = env.OS_LIST_NAME | .description = env.OS_LIST_DESC | .icon = env.OS_LIST_ICON | .devices = [ env.DEVICE ] | .tags = [ "education" ] | .url = env.URL | .image_download_sha256 = env.SHA | .release_date = env.RELEASE_DATE | .extract_size = $extract_size ]' > os_list_stable.json
6266
6367
- name: OS List Generation
6468
uses: softprops/action-gh-release@v2

0 commit comments

Comments
 (0)