diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index cc03edc3bb..e9920e9075 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -16,8 +16,9 @@ jobs: outputs: build_matrix: ${{ steps.generate_build_matrix.outputs.build_matrix }} - is_empty: ${{ steps.generate_build_matrix.outputs.is_empty }} - + container: + image: registry.fedoraproject.org/fedora:37 + options: --cap-add=SYS_ADMIN --privileged # check out the repo steps: - name: Checkout @@ -27,34 +28,46 @@ jobs: - run: git fetch #- run: git checkout HEAD^ - - name: Generate Build matrix - id: generate_build_matrix - # generate build matrix by checking out changes in anda/ + - name: Set up dependencies run: | - # get the list of changed folders in the current commit, including subfolders - changed_folders=$(git diff --name-only HEAD^ | grep -oP 'anda\/(.+)(\/|\$)' | sort -u ) - echo "Changed folders: $changed_folders" - # if changed_folders is empty then set is empty to true - if [ -z "$changed_folders" ]; then - echo "::set-output name=is_empty::true" - else - echo "::set-output name=is_empty::false" - fi - # turn it into a json array - build_matrix=$(echo "$changed_folders" | jq -R . | jq -s . | jq -c .) + sudo dnf install -y dnf-plugins-core + sudo dnf config-manager --add-repo https://github.com/andaman-common-pkgs/subatomic-repos/raw/main/ad37.repo + sudo dnf install -y anda mock rpm-build git-core + # add to safe directory + git config --global --add safe.directory "$GITHUB_WORKSPACE" - echo "::set-output name=build_matrix::$build_matrix" - #echo "::set-output name=build_matrix::$build_matrix" + # - name: Generate Build matrix + # id: generate_build_matrix + # # generate build matrix by checking out changes in anda/ + # run: | + # # get the list of changed folders in the current commit, including subfolders + # changed_folders=$(git diff --name-only HEAD^ | grep -oP 'anda\/(.+)(\/|\$)' | sort -u ) + # echo "Changed folders: $changed_folders" + # # if changed_folders is empty then set is empty to true + # if [ -z "$changed_folders" ]; then + # echo "::set-output name=is_empty::true" + # else + # echo "::set-output name=is_empty::false" + # fi + # # turn it into a json array + # build_matrix=$(echo "$changed_folders" | jq -R . | jq -s . | jq -c .) + + # echo "::set-output name=build_matrix::$build_matrix" + # #echo "::set-output name=build_matrix::$build_matrix" + + - name: Generate build matrix + id: generate_build_matrix + run: | + anda ci >> $GITHUB_OUTPUT build: needs: manifest strategy: matrix: pkg: ${{ fromJson(needs.manifest.outputs.build_matrix) }} - version: ["ad37"] - arch: ["x86_64", "aarch64"] + version: ["37"] fail-fast: false #if: ${{ matrix.changed_folders != '' }} - runs-on: ${{ matrix.arch == 'aarch64' && 'ARM64' || 'ubuntu-latest' }} + runs-on: ${{ matrix.pkg.arch == 'aarch64' && 'ARM64' || 'ubuntu-latest' }} container: image: registry.fedoraproject.org/fedora:37 options: --cap-add=SYS_ADMIN --privileged @@ -62,16 +75,16 @@ jobs: - name: Install repositories run: | sudo dnf install -y dnf-plugins-core - sudo dnf config-manager --add-repo https://github.com/andaman-common-pkgs/subatomic-repos/raw/main/ad37.repo + sudo dnf config-manager --add-repo https://github.com/andaman-common-pkgs/subatomic-repos/raw/main/ad${{ matrix.version }}.repo sudo dnf install -y anda-mock-configs subatomic-cli anda mock rpm-build mock-scm - uses: terrapkg/anda-build@main if: ${{ !fromJson(needs.manifest.outputs.is_empty) }} with: - name: "${{ matrix.pkg }}pkg" - mockConfig: anda-37-${{ matrix.arch }} + name: "${{ matrix.pkg.pkg }}" + mockConfig: anda-${{ matrix.version }}-${{ matrix.pkg.arch }} extraArgs: -D "sccache_bucket ${{secrets.SCCACHE_BUCKET}}" -D "sccache_endpoint ${{secrets.SCCACHE_ENDPOINT}}" -D "sccache_secret ${{secrets.SCCACHE_SECRET}}" -D "sccache_accesskey ${{secrets.SCCACHE_ACCESSKEY}}" - andaRepo: https://github.com/andaman-common-pkgs/subatomic-repos/raw/main/ad37.repo + andaRepo: https://github.com/andaman-common-pkgs/subatomic-repos/raw/main/ad${{ matrix.version }}.repo - name: Install Subatomic client run: sudo dnf install -y subatomic-cli @@ -82,4 +95,4 @@ jobs: subatomic-cli upload --prune \ --server https://subatomic.fyralabs.com \ --token ${{ secrets.SUBATOMIC_TOKEN }} \ - ${{ matrix.version }} anda-build/rpm/rpms/* + ad${{ matrix.version }} anda-build/rpm/rpms/* diff --git a/anda/mock-configs/anda-mock-configs.spec b/anda/mock-configs/anda-mock-configs.spec index 58df75f1df..9be45a6688 100644 --- a/anda/mock-configs/anda-mock-configs.spec +++ b/anda/mock-configs/anda-mock-configs.spec @@ -23,7 +23,6 @@ BuildArch: noarch %build - %install mkdir -p %{buildroot}%{_sysusersdir} mkdir -p %{buildroot}%{_sysconfdir}/mock/templates