mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-08-22 04:43:33 +02:00
Refactor addon build-args to use yq for YAML files
https://github.com/alexbelgium/hassio-addons/issues/2966
This commit is contained in:
16
.github/workflows/onpr_check-pr.yaml
vendored
16
.github/workflows/onpr_check-pr.yaml
vendored
@@ -193,15 +193,15 @@ jobs:
|
||||
|
||||
- name: 💽 Create addon build-args
|
||||
id: build_args
|
||||
shell: bash
|
||||
run: |
|
||||
{
|
||||
echo "armhf=BUILD_FROM=$(jq -r .build_from.armhf // empty ${{ steps.information.outputs.build }})"
|
||||
echo "armv7=BUILD_FROM=$(jq -r .build_from.armv7 // empty ${{ steps.information.outputs.build }})"
|
||||
echo "aarch64=BUILD_FROM=$(jq -r .build_from.aarch64 // empty ${{ steps.information.outputs.build }})"
|
||||
echo "amd64=BUILD_FROM=$(jq -r .build_from.amd64 // empty ${{ steps.information.outputs.build }})"
|
||||
echo "i386=BUILD_FROM=$(jq -r .build_from.i386 // empty ${{ steps.information.outputs.build }})"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
build_file="${{ steps.information.outputs.build }}"
|
||||
case "$build_file" in
|
||||
*.yaml|*.yml) build_json="$(yq -o=json '.' "$build_file")" ;;
|
||||
*) build_json="$(cat "$build_file")" ;;
|
||||
esac
|
||||
for arch in armhf armv7 aarch64 amd64 i386; do
|
||||
echo "${arch}=BUILD_FROM=$(printf '%s' "$build_json" | jq -r --arg a "$arch" '.build_from[$a] // empty')"
|
||||
done >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: 🏗️ Set up QEMU
|
||||
uses: docker/setup-qemu-action@v4
|
||||
|
||||
Reference in New Issue
Block a user