diff --git a/.github/workflows/builder.yaml b/.github/workflows/builder.yaml index 7af8627..9c38709 100644 --- a/.github/workflows/builder.yaml +++ b/.github/workflows/builder.yaml @@ -86,15 +86,25 @@ jobs: - name: Check if add-on should be built id: check run: | - if [[ "${{ steps.info.outputs.architectures }}" =~ ${{ matrix.arch }} ]]; then - echo "build_arch=true" >> $GITHUB_OUTPUT; - echo "image=$(echo ${{ steps.info.outputs.image }} | cut -d'/' -f3)" >> $GITHUB_OUTPUT; - if [[ -z "${{ github.head_ref }}" ]] && [[ "${{ github.event_name }}" == "push" ]]; then - echo "BUILD_ARGS=" >> $GITHUB_ENV; - fi - else - echo "${{ matrix.arch }} is not in build.yaml for ${{ matrix.addon }}, skipping build"; - echo "build_arch=false" >> $GITHUB_OUTPUT; + build_archs=${{ steps.info.outputs.architectures }} + config_archs=$(yq eval -o=json '.arch' ./${{ matrix.addon }}/config.yaml | jq -c '.') + echo "From build.yaml: $build_archs" + echo "From config.yaml: $config_archs" + + if [[ "${build_archs}" =~ ${{ matrix.arch }} ]]; then + if [[ "${config_archs}" =~ ${{ matrix.arch }} ]]; then + echo "build_arch=true" >> $GITHUB_OUTPUT; + echo "image=$(echo ${{ steps.info.outputs.image }} | cut -d'/' -f3)" >> $GITHUB_OUTPUT; + if [[ -z "${{ github.head_ref }}" ]] && [[ "${{ github.event_name }}" == "push" ]]; then + echo "BUILD_ARGS=" >> $GITHUB_ENV; + fi + else + echo "${{ matrix.arch }} is not in condig.yaml for ${{ matrix.addon }}, skipping build"; + echo "build_arch=false" >> $GITHUB_OUTPUT; + fi + else + echo "${{ matrix.arch }} is not in build.yaml for ${{ matrix.addon }}, skipping build"; + echo "build_arch=false" >> $GITHUB_OUTPUT; fi # - name: Login to GitHub Container Registry