Skip to content

Commit

Permalink
feat(ci): make autobuild run on pull_request (#228)
Browse files Browse the repository at this point in the history
* Make autobuild run on pull_request

* let's try something

Signed-off-by: lleyton <[email protected]>

---------

Signed-off-by: lleyton <[email protected]>
  • Loading branch information
lleyton authored Mar 19, 2023
1 parent 59042a1 commit b8c45c0
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/autobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- anda/**
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
workflow_call:

Expand All @@ -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: |
Expand All @@ -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 \
Expand Down

0 comments on commit b8c45c0

Please sign in to comment.