Skip to content

Commit d098797

Browse files
committed
ci: fix workflow YAML and use jq to build platform artifact list
1 parent df06190 commit d098797

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/build-and-upload-aml.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Install build dependencies
1919
run: |
2020
sudo apt-get update
21-
sudo apt-get install -y build-essential cmake ninja-build zip python3 python3-pip
21+
sudo apt-get install -y build-essential cmake ninja-build zip python3 python3-pip jq
2222
2323
- name: Configure CMake
2424
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
@@ -47,12 +47,12 @@ jobs:
4747
fi
4848
done
4949
50-
# Convert platforms array to JSON
51-
PLATFORMS_JSON=$(python3 - <<'PY'
52-
import json,sys
53-
print(json.dumps(sys.argv[1:]))
54-
PY
55-
${platforms[@]:-})
50+
# Convert platforms array to JSON using jq
51+
if [ ${#platforms[@]} -gt 0 ]; then
52+
PLATFORMS_JSON=$(printf '%s\n' "${platforms[@]}" | jq -R -s -c 'split("\n")[:-1]')
53+
else
54+
PLATFORMS_JSON='[]'
55+
fi
5656
5757
echo "Found platforms: $PLATFORMS_JSON"
5858
echo "platforms=$PLATFORMS_JSON" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)