diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ec46fe284d..77d428a885e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -124,19 +124,11 @@ jobs: runs-on: ubuntu-latest needs: prepare outputs: - add_noarch_builds: ${{ steps.defaults.outputs.add_noarch_builds }} - add_noarch_dsm72_builds: ${{ steps.defaults.outputs.add_noarch_dsm72_builds }} - add_dsm72_builds: ${{ steps.defaults.outputs.add_dsm72_builds }} - add_dsm71_builds: ${{ steps.defaults.outputs.add_dsm71_builds }} - add_dsm62_builds: ${{ steps.defaults.outputs.add_dsm62_builds }} - add_dsm52_builds: ${{ steps.defaults.outputs.add_dsm52_builds }} - add_srm12_builds: ${{ steps.defaults.outputs.add_srm12_builds }} - has_noarch_packages: ${{ steps.defaults.outputs.has_noarch_packages }} - has_arch_packages: ${{ steps.defaults.outputs.has_arch_packages }} + matrix: ${{ steps.defaults.outputs.matrix }} steps: - id: defaults run: | - # Retrieve user inputs or set fallback defaults + # Retrieve inputs and package availability add_noarch_builds=${{ github.event.inputs.add_noarch_builds || 'false' }} add_noarch_dsm72_builds=${{ github.event.inputs.add_noarch_dsm72_builds || 'false' }} add_dsm72_builds=${{ github.event.inputs.add_dsm72_builds || 'false' }} @@ -144,8 +136,6 @@ jobs: add_dsm62_builds=${{ github.event.inputs.add_dsm62_builds || 'false' }} add_dsm52_builds=${{ github.event.inputs.add_dsm52_builds || 'false' }} add_srm12_builds=${{ github.event.inputs.add_srm12_builds || 'false' }} - - # Dynamically check for package availability and requirements has_noarch_packages=$([ -n "${{ needs.prepare.outputs.noarch_packages }}" ] && echo "true" || echo "false") has_arch_packages=$([ -n "${{ needs.prepare.outputs.arch_packages }}" ] && echo "true" || echo "false") has_min_dsm72_packages=${{ needs.prepare.outputs.has_min_dsm72_packages || 'false' }} @@ -168,27 +158,7 @@ jobs: add_dsm62_builds=$([ "$has_arch_packages" == "true" ] && echo "true" || echo "false") fi - # Output all values - echo "add_noarch_builds=$add_noarch_builds" >> $GITHUB_OUTPUT - echo "add_noarch_dsm72_builds=$add_noarch_dsm72_builds" >> $GITHUB_OUTPUT - echo "add_dsm72_builds=$add_dsm72_builds" >> $GITHUB_OUTPUT - echo "add_dsm71_builds=$add_dsm71_builds" >> $GITHUB_OUTPUT - echo "add_dsm62_builds=$add_dsm62_builds" >> $GITHUB_OUTPUT - echo "add_dsm52_builds=$add_dsm52_builds" >> $GITHUB_OUTPUT - echo "add_srm12_builds=$add_srm12_builds" >> $GITHUB_OUTPUT - echo "has_noarch_packages=$has_noarch_packages" >> $GITHUB_OUTPUT - echo "has_arch_packages=$has_arch_packages" >> $GITHUB_OUTPUT - - generate-matrix: - name: Generate Matrix - runs-on: ubuntu-latest - needs: set-defaults - outputs: - matrix: ${{ steps.matrix.outputs.matrix }} - steps: - - id: matrix - run: | - # Initialize an empty matrix using jq + # Build matrix matrix=$(jq -n '{"include": []}') # Helper function to add entries to the matrix @@ -196,17 +166,6 @@ jobs: matrix=$(echo "$matrix" | jq --arg arch "$1" '.include += [{"arch": $arch}]') } - # Parse outputs from set-defaults - add_noarch_builds="${{ needs.set-defaults.outputs.add_noarch_builds }}" - add_noarch_dsm72_builds="${{ needs.set-defaults.outputs.add_noarch_dsm72_builds }}" - add_dsm72_builds="${{ needs.set-defaults.outputs.add_dsm72_builds }}" - add_dsm71_builds="${{ needs.set-defaults.outputs.add_dsm71_builds }}" - add_dsm62_builds="${{ needs.set-defaults.outputs.add_dsm62_builds }}" - add_dsm52_builds="${{ needs.set-defaults.outputs.add_dsm52_builds }}" - add_srm12_builds="${{ needs.set-defaults.outputs.add_srm12_builds }}" - has_noarch_packages="${{ needs.set-defaults.outputs.has_noarch_packages }}" - has_arch_packages="${{ needs.set-defaults.outputs.has_arch_packages }}" - # Add noarch builds if [ "$add_noarch_builds" == "true" ] && [ "$has_noarch_packages" == "true" ]; then add_to_matrix "noarch-1.1" @@ -262,11 +221,11 @@ jobs: build: name: Build - needs: [prepare, set-defaults, generate-matrix] + needs: set-defaults runs-on: ubuntu-latest strategy: fail-fast: false - matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }} + matrix: ${{ fromJSON(needs.set-defaults.outputs.matrix) }} steps: - name: Checkout repository uses: actions/checkout@v4