diff --git a/.github/workflows/main_build_status.yml b/.github/workflows/main_build_status.yml new file mode 100644 index 0000000000..6b76c3c568 --- /dev/null +++ b/.github/workflows/main_build_status.yml @@ -0,0 +1,27 @@ +# Reports the newest push build of main that was not cancelled, for the README badge. +name: Main build status + +on: + workflow_run: + workflows: ["Build all"] + types: [completed] + branches: [main] + +permissions: + actions: read + +jobs: + status: + if: github.repository == 'OrcaSlicer/OrcaSlicer' + runs-on: ubuntu-latest + steps: + - env: + GH_TOKEN: ${{ github.token }} + run: | + for attempt in 1 2 3; do + conclusion=$(gh api "repos/${{ github.repository }}/actions/workflows/build_all.yml/runs?branch=main&event=push&status=completed&per_page=100" \ + --jq '[.workflow_runs[] | select(.conclusion != "cancelled")][0].conclusion') && break + sleep 10 + done + echo "Latest finished push build of main: $conclusion" + [ "$conclusion" = success ] diff --git a/README.md b/README.md index e9a28ba4f3..40ba7637b9 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ OrcaSlicer%2FOrcaSlicer | Trendshift -[![GitHub Repo stars](https://img.shields.io/github/stars/OrcaSlicer/OrcaSlicer)](https://github.com/OrcaSlicer/OrcaSlicer/stargazers) [![Build all](https://github.com/OrcaSlicer/OrcaSlicer/actions/workflows/build_all.yml/badge.svg?branch=main)](https://github.com/OrcaSlicer/OrcaSlicer/actions/workflows/build_all.yml) +[![GitHub Repo stars](https://img.shields.io/github/stars/OrcaSlicer/OrcaSlicer)](https://github.com/OrcaSlicer/OrcaSlicer/stargazers) [![Build all](https://img.shields.io/github/actions/workflow/status/OrcaSlicer/OrcaSlicer/main_build_status.yml?label=Build%20all)](https://github.com/OrcaSlicer/OrcaSlicer/actions/workflows/build_all.yml) OrcaSlicer: an open source Next-Gen Slicing Software for Precision 3D Prints. Optimize your prints with ultra-fast slicing, intelligent support generation, and seamless printer compatibility—engineered for perfection.