ci - main reusable caller #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # @credits https://github.com/c0re100/qBittorrent-Enhanced-Edition | |
| name: ci - main reusable caller | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| script_name: | |
| description: "Which script to run?" | |
| required: true | |
| default: "qbt-nox-static.bash" | |
| type: choice | |
| options: ["qbt-nox-static.bash", "qbittorrent-nox-static.sh"] | |
| debian-build: | |
| description: "Debian: build" | |
| required: true | |
| default: false | |
| type: boolean | |
| alpine-build: | |
| description: "Alpine: build" | |
| required: true | |
| default: true | |
| type: boolean | |
| workflow-files: | |
| description: "Workflow files" | |
| required: true | |
| default: true | |
| type: boolean | |
| icu: | |
| description: "Enable icu" | |
| required: true | |
| default: false | |
| type: boolean | |
| debug: | |
| description: "Debug builds (symbols)" | |
| required: true | |
| default: false | |
| type: boolean | |
| release: | |
| description: "Release assets?" | |
| required: true | |
| default: true | |
| type: boolean | |
| distinct_id: | |
| description: "Distinct id" | |
| required: false | |
| type: string | |
| skip_rerun: | |
| description: "Skip rerun?" | |
| required: true | |
| default: false | |
| type: boolean | |
| retries: | |
| description: "Number of rerun retries" | |
| required: true | |
| default: "1" | |
| type: choice | |
| options: ["1", "2", "3", "4", "5", "6", "7", "8", "9"] | |
| permissions: {} | |
| jobs: | |
| ci-debian-build: | |
| if: github.event.inputs.debian-build == 'true' | |
| concurrency: | |
| group: ci-debian-build | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| uses: ./.github/workflows/ci-debian-build.yml | |
| with: | |
| distinct_id: ${{ github.event.inputs.distinct_id }} | |
| workflow-files: ${{ github.event.inputs.workflow-files == 'true' && 'yes' || 'no' }} | |
| icu: ${{ github.event.inputs.icu == 'true' && 'no' || 'yes' }} | |
| debug: ${{ github.event.inputs.debug == 'true' && 'yes' || 'no' }} | |
| script_name: ${{ github.event.inputs.script_name }} | |
| ci-alpine-build: | |
| if: github.event.inputs.alpine-build == 'true' | |
| concurrency: | |
| group: ci-alpine-build | |
| cancel-in-progress: true | |
| permissions: | |
| id-token: write | |
| contents: read | |
| attestations: write | |
| uses: ./.github/workflows/ci-alpine-build.yml | |
| with: | |
| distinct_id: ${{ github.event.inputs.distinct_id }} | |
| workflow-files: ${{ github.event.inputs.workflow-files == 'true' && 'yes' || 'no' }} | |
| icu: ${{ github.event.inputs.icu == 'true' && 'no' || 'yes' }} | |
| debug: ${{ github.event.inputs.debug == 'true' && 'yes' || 'no' }} | |
| script_name: ${{ github.event.inputs.script_name }} | |
| ci-alpine-release: | |
| needs: [ci-alpine-build] | |
| if: github.event.inputs.release == 'true' && contains(needs.*.result, 'success') && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') | |
| concurrency: | |
| group: ci-alpine-release | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| uses: ./.github/workflows/ci-alpine-release.yml | |
| with: | |
| distinct_id: ${{ github.event.inputs.distinct_id }} | |
| ci-auto-rerun-failed-jobs: | |
| if: failure() && (github.event.inputs.skip_rerun || 'false') == 'false' | |
| needs: [ci-debian-build, ci-alpine-build, ci-alpine-release] | |
| concurrency: | |
| group: ci-auto-rerun-failed-jobs | |
| cancel-in-progress: true | |
| permissions: | |
| actions: write | |
| runs-on: ubuntu-24.04-arm | |
| env: | |
| GH_TOKEN: "${{ secrets.AUTO_RERUN || github.token }}" | |
| github_repo: "" # To use ci-auto-rerun-failed-jobs.yml hosted in a remote repository else default to the current repository. Requires PAT token AUTO_RERUN | |
| retries: ${{ github.event.inputs.retries || '1' }} | |
| distinct_id: ${{ github.event.inputs.distinct_id }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: ci-auto-rerun-failed-jobs via ${{ env.github_repo || github.repository }} | |
| run: > | |
| gh workflow run ci-auto-rerun-failed-jobs-action.yml | |
| --repo "${github_repo:-$GITHUB_REPOSITORY}" | |
| -f github_repo=${GITHUB_REPOSITORY} | |
| -f run_id=${GITHUB_RUN_ID} | |
| -f attempts=${GITHUB_RUN_ATTEMPT} | |
| -f retries=${retries} | |
| -f distinct_id=${distinct_id} |