Skip to content

Commit

Permalink
ci: upload bin and txt to relase
Browse files Browse the repository at this point in the history
  • Loading branch information
georgik committed Jan 22, 2024
1 parent f263279 commit 4e459df
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions .github/workflows/build-rust-no_std-hello-world.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ jobs:
# Upload loop for each binary
cd ${PROJECT}/examples/rust/no_std/hello-world
for TARGET in esp32; do
OUTPUT_BIN="rust-no_std-hello-world-${TARGET}-${{ github.event.inputs.release_tag }}.bin"
OUTPUT_PREFIX="rust-no_std-hello-world-${TARGET}-${{ github.event.inputs.release_tag }}"
OUTPUT_BIN="${OUTPUT_PREFIX}.bin"
OUTPUT_TXT="${OUTPUT_PREFIX}.txt"
# If TARGET is a substring in SKIP_PROJECTS, skip it
#if echo "${{ github.event.inputs.skip_projects }}" | grep -q "${TARGET}"; then
Expand All @@ -90,15 +92,16 @@ jobs:
# Using alias from .cargo/config.toml
cargo "save-image-${TARGET}" --release --merge --skip-padding ${OUTPUT_BIN}
# If skip-wokwi-test.toml exists, skip Wokwi test
#if [ -f "skip-wokwi-test.toml" ]; then
# echo "Skipping Wokwi test for $TARGET"
#else
/home/esp/bin/wokwi-cli --timeout 5000 --timeout-exit-code 0 --screenshot-time 5000 "."
#fi
# Run Wokwi test
/home/esp/bin/wokwi-cli --timeout 5000 \
--timeout-exit-code 0 \
--serial-log-file ${OUTPUT_TXT} \
"."
cat ${OUTPUT_TXT}
asset_path="/home/esp/${PROJECT}/target/xtensa-esp32-none-elf/release/hello-world"
#asset_path="/home/esp/${PROJECT}/${OUTPUT_BIN}"
# Upload binary
asset_path="/home/esp/${PROJECT}/${OUTPUT_BIN}"
asset_name="${OUTPUT_BIN}"
curl \
--request POST \
Expand All @@ -107,6 +110,16 @@ jobs:
--data-binary "@$asset_path" \
--url "${{ needs.get_release.outputs.upload_url }}?name=${asset_name}"
# Upload log
asset_path="/home/esp/${PROJECT}/${OUTPUT_TXT}"
asset_name="${OUTPUT_TXT}"
curl \
--request POST \
--header "authorization: Bearer $GITHUB_TOKEN" \
--header "Content-Type: application/octet-stream" \
--data-binary "@$asset_path" \
--url "${{ needs.get_release.outputs.upload_url }}?name=${asset_name}"
# If skip-wokwi-test.toml exists, skip Wokwi test
#if [ ! -f "skip-wokwi-test.toml" ]; then
# asset_path="/home/esp/project/${TARGET}/screenshot.png"
Expand Down

0 comments on commit 4e459df

Please sign in to comment.