diff --git a/.github/workflows/carbonix_build.yml b/.github/workflows/carbonix_build.yml index 168b258814..6103668d95 100644 --- a/.github/workflows/carbonix_build.yml +++ b/.github/workflows/carbonix_build.yml @@ -459,15 +459,37 @@ jobs: build-upload-zip: runs-on: ubuntu-22.04 if: ${{ !contains(github.event.pull_request.labels.*.name, 'SKIP_BUILD') }} - needs: [build-periph, build-sitl, collect-aircraft-config-files, setup-s3-path] + needs: [process-ac, build-sitl, s3-path] steps: - name: Create folder from s3_path run: mkdir -p ${{ needs.setup-s3-path.outputs.s3_path }} - - name: Download build artifacts + - name: List available artifacts + id: list-artifacts + uses: actions/github-script@v6 + with: + script: | + const artifacts = await github.actions.listArtifactsForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + }); + return artifacts.data.artifacts.map(artifact => artifact.name); + + - name: Filter artifacts + id: filter-artifacts + run: | + echo "Filtered artifacts:" > filtered_artifacts.txt + for artifact in ${{ steps.list-artifacts.outputs.result }}; do + if [[ $artifact =~ .*_AC_.*[0-9]+(\.[0-9]+)? ]]; then + echo $artifact >> filtered_artifacts.txt + fi + done + cat filtered_artifacts.txt + + - name: Download filtered artifacts uses: actions/download-artifact@v4 with: - name: output-ac-* + name: ${{ steps.filter-artifacts.outputs.result }} path: ${{ needs.setup-s3-path.outputs.s3_path }} - name: List downloaded files @@ -482,5 +504,5 @@ jobs: uses: actions/upload-artifact@v4 with: name: zipped-artifacts - path: artifact.zip + path: ${{ needs.setup-s3-path.outputs.s3_path }}.zip retention-days: 15