diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 6e8f11431e..37197bb4e4 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -29,26 +29,6 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - #- run: git checkout HEAD^ - - # - 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: | @@ -80,7 +60,8 @@ jobs: 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/terrapkg/subatomic-repos/raw/main/terra${{ matrix.version }}.repo - - id: art + - name: Generating artifact name + id: art run: | NAME=${{ matrix.pkg.pkg }}-${{ matrix.pkg.arch }}-${{ matrix.version }} x=${NAME//\//@} @@ -98,3 +79,7 @@ jobs: --server https://subatomic.fyralabs.com \ --token ${{ secrets.SUBATOMIC_TOKEN }} \ terra${{ matrix.version }} anda-build/rpm/rpms/* + + - name: Notify Madoguchi + if: always() + run: ./.github/workflows/mg.sh ${{success()}} ${{matrix.pkg.pkg}} ${{matrix.version}} ${{matrix.pkg.arch}} ${{github.run_id}} ${{secrets.MADOGUCHI_JWT}} diff --git a/.github/workflows/mg.sh b/.github/workflows/mg.sh new file mode 100644 index 0000000000..2078f87d5a --- /dev/null +++ b/.github/workflows/mg.sh @@ -0,0 +1,12 @@ +if $1; then + dirs=${$2/\/pkg/} + export p="{\"id\":\"$5\",\"verl\":\"%v\",\"arch\":\"$4\",\"dirs\":\"$dirs\"}" +else + export p="{\"id\":\"$5\",\"verl\":\"%v\",\"arch\":\"$4\"}" +fi +for f in anda-build/rpm/rpms/*; do + n=$(lesspipe.sh $f | grep -E "Name\s*: " | sed "s@Name\s*: @@") + v=$(echo ${f/${n}-/} | sed -E "s@\.fc$3.+@@") + curl -H "Authorization: Bearer $6" https://madoguchi.fyralabs.com/ci/terra$3/builds/$n -X PUT -H "Content-Type: application/json" -d ${p/%v/$v} --fail-with-body & +done +wait