Build, test, and release workflow fixes #332
Workflow file for this run
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
| name: Kernelkit Trigger | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled] | |
| push: | |
| branches: | |
| - main | |
| - ci-work | |
| workflow_dispatch: | |
| jobs: | |
| # Gate all builds through this check to prevent duplicate runs when a PR is | |
| # created with the ci:main label already attached. Without this, both the | |
| # 'opened' and 'labeled' events would trigger separate builds. Only run on | |
| # 'labeled' events when the label is actually 'ci:main'. See issue #1154. | |
| check-trigger: | |
| if: | | |
| startsWith(github.repository, 'kernelkit/') && | |
| (github.event_name != 'pull_request' || | |
| github.event.action != 'labeled' || | |
| github.event.label.name == 'ci:main') | |
| runs-on: ubuntu-latest | |
| outputs: | |
| x86_64_target: ${{ steps.set-targets.outputs.x86_64_target }} | |
| aarch64_target: ${{ steps.set-targets.outputs.aarch64_target }} | |
| steps: | |
| - run: | | |
| echo "Triggering build ——————————————————————————————————————————————" | |
| echo "Event : ${{ github.event_name }}" | |
| echo "Action : ${{ github.event.action }}" | |
| echo "Ref : ${{ github.ref }}" | |
| echo "PR : ${{ github.event.pull_request.number }}" | |
| echo "Label : ${{ github.event.label.name }}" | |
| - id: set-targets | |
| run: | | |
| if [[ "${{ github.event_name }}" == "pull_request" ]] && \ | |
| ! echo '${{ toJSON(github.event.pull_request.labels.*.name) }}' \ | |
| | grep -q "ci:main"; then | |
| echo "x86_64_target=x86_64_minimal" >> $GITHUB_OUTPUT | |
| echo "aarch64_target=aarch64_minimal" >> $GITHUB_OUTPUT | |
| else | |
| echo "x86_64_target=x86_64" >> $GITHUB_OUTPUT | |
| echo "aarch64_target=aarch64" >> $GITHUB_OUTPUT | |
| fi | |
| build-x86_64: | |
| needs: check-trigger | |
| uses: ./.github/workflows/build.yml | |
| with: | |
| name: "infix" | |
| target: ${{ needs.check-trigger.outputs.x86_64_target }} | |
| build-aarch64: | |
| needs: check-trigger | |
| uses: ./.github/workflows/build.yml | |
| with: | |
| name: "infix" | |
| target: ${{ needs.check-trigger.outputs.aarch64_target }} | |
| test-run-x86_64: | |
| needs: [check-trigger, build-x86_64] | |
| uses: ./.github/workflows/test.yml | |
| with: | |
| target: ${{ needs.check-trigger.outputs.x86_64_target }} | |
| name: "infix" | |
| test-publish-x86_64: | |
| needs: test-run-x86_64 | |
| uses: ./.github/workflows/publish.yml |