diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index e992fd88a1..3136297f64 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -7,6 +7,9 @@ on: - anda/** branches: - main + pull_request: + branches: + - main workflow_dispatch: workflow_call: @@ -25,8 +28,27 @@ jobs: - name: Checkout uses: actions/checkout@v3 with: - fetch-depth: 2 - - run: git pull + 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: | @@ -50,7 +72,13 @@ 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 + - uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.pkg.pkg }}-${{ matrix.pkg.arch }}-${{ matrix.version }} + path: anda-build/rpm/rpms/* + - name: Upload packages to subatomic + if: github.event_name != 'pull_request' run: | subatomic-cli upload --prune \ --server https://subatomic.fyralabs.com \