ci(actions): upgrade retry action to v4 #4752
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 'fix/*' | |
| - 'feature/*' | |
| - 'poc/*' | |
| - 'support/*' | |
| - 'next/*' | |
| paths: | |
| - '**' | |
| - '!docs/**' | |
| pull_request: | |
| branches: | |
| - main | |
| - 'support/*' | |
| - 'next/*' | |
| paths: | |
| - '**' | |
| - '!docs/**' | |
| merge_group: | |
| types: [ checks_requested ] | |
| repository_dispatch: | |
| types: [ ci-release ] | |
| env: | |
| DOTNET_ROLL_FORWARD: "Major" | |
| DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
| DOTNET_NOLOGO: 1 | |
| TESTINGPLATFORM_TELEMETRY_OPTOUT: 1 | |
| ENABLED_DIAGNOSTICS: ${{ vars.ENABLED_DIAGNOSTICS }} | |
| permissions: | |
| id-token: write | |
| contents: read | |
| packages: write | |
| attestations: write | |
| jobs: | |
| prepare: | |
| name: Prepare | |
| uses: ./.github/workflows/_prepare.yml | |
| publish_flags: | |
| name: Publish Flags | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| can_publish: ${{ steps.flags.outputs.can_publish }} | |
| steps: | |
| - name: Resolve publish flag | |
| id: flags | |
| shell: bash | |
| run: echo "can_publish=${{ github.repository == 'GitTools/GitVersion' && github.ref_name == 'main' }}" >> "$GITHUB_OUTPUT" | |
| build: | |
| name: Build & Package | |
| needs: [ prepare ] | |
| uses: ./.github/workflows/_build.yml | |
| unit_test: | |
| name: Test | |
| needs: [ prepare, publish_flags ] | |
| uses: ./.github/workflows/_unit_tests.yml | |
| with: | |
| dotnet_versions: ${{ needs.prepare.outputs.dotnet_versions }} | |
| publish_coverage: ${{ fromJson(needs.publish_flags.outputs.can_publish) }} | |
| secrets: inherit | |
| artifacts_windows_test: | |
| name: Artifacts Windows | |
| needs: [ build ] | |
| uses: ./.github/workflows/_artifacts_windows.yml | |
| artifacts_linux_test: | |
| needs: [ prepare, build ] | |
| name: Artifacts Linux (${{ matrix.arch }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - arch: amd64 | |
| runner: ubuntu-24.04 | |
| - arch: arm64 | |
| runner: ubuntu-24.04-arm | |
| uses: ./.github/workflows/_artifacts_linux.yml | |
| with: | |
| runner: ${{ matrix.runner }} | |
| arch: ${{ matrix.arch }} | |
| docker_distros: ${{ needs.prepare.outputs.docker_distros }} | |
| dotnet_versions: ${{ needs.prepare.outputs.dotnet_versions }} | |
| docker_linux_images: | |
| needs: [ prepare, build, publish_flags ] | |
| name: Docker Images (${{ matrix.arch }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - arch: amd64 | |
| runner: ubuntu-24.04 | |
| - arch: arm64 | |
| runner: ubuntu-24.04-arm | |
| uses: ./.github/workflows/_docker.yml | |
| with: | |
| runner: ${{ matrix.runner }} | |
| arch: ${{ matrix.arch }} | |
| docker_distros: ${{ needs.prepare.outputs.docker_distros }} | |
| dotnet_versions: ${{ needs.prepare.outputs.dotnet_versions }} | |
| publish_images: ${{ fromJson(needs.publish_flags.outputs.can_publish) }} | |
| secrets: inherit | |
| docker_linux_manifests: | |
| needs: [ prepare, docker_linux_images, publish_flags ] | |
| name: Docker Manifests | |
| uses: ./.github/workflows/_docker_manifests.yml | |
| with: | |
| docker_distros: ${{ needs.prepare.outputs.docker_distros }} | |
| dotnet_versions: ${{ needs.prepare.outputs.dotnet_versions }} | |
| publish_manifests: ${{ fromJson(needs.publish_flags.outputs.can_publish) }} | |
| secrets: inherit | |
| publish: | |
| name: Publish | |
| needs: [ artifacts_windows_test, artifacts_linux_test, publish_flags ] | |
| uses: ./.github/workflows/_publish.yml | |
| with: | |
| publish_packages: ${{ fromJson(needs.publish_flags.outputs.can_publish) }} | |
| secrets: inherit | |
| release: | |
| name: Release | |
| needs: [ publish, docker_linux_manifests ] | |
| runs-on: windows-2025-vs2026 | |
| permissions: | |
| contents: write | |
| packages: write | |
| id-token: write | |
| attestations: write | |
| issues: write | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| CAN_PUBLISH: ${{ github.event_name == 'repository_dispatch' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Restore State | |
| uses: ./.github/actions/cache-restore | |
| - name: Restore Artifacts | |
| uses: ./.github/actions/artifacts-restore | |
| - name: Attestation | |
| if: env.CAN_PUBLISH == 'true' | |
| uses: ./.github/actions/artifacts-attest | |
| - name: Load DockerHub credentials | |
| id: dockerhub-creds | |
| if: env.CAN_PUBLISH == 'true' | |
| uses: gittools/cicd/dockerhub-creds@v1 | |
| with: | |
| op_service_account_token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} | |
| - name: DockerHub Publish Readme | |
| if: env.CAN_PUBLISH == 'true' | |
| shell: pwsh | |
| run: dotnet run/docker.dll --target=DockerHubReadmePublish | |
| env: | |
| DOCKER_USERNAME: ${{ steps.dockerhub-creds.outputs.docker_username }} | |
| DOCKER_PASSWORD: ${{ steps.dockerhub-creds.outputs.docker_password }} | |
| - name: '[Release]' | |
| shell: pwsh | |
| run: dotnet run/release.dll --target=PublishRelease | |
| - name: '[Publish Release]' | |
| if: github.event_name == 'repository_dispatch' | |
| uses: peter-evans/repository-dispatch@v4 | |
| with: | |
| token: ${{ github.token }} | |
| repository: ${{ github.repository }} | |
| event-type: publish-release | |
| client-payload: | | |
| { | |
| "ref": "${{ github.ref }}", | |
| "sha": "${{ github.sha }}", | |
| "tag": "${{ github.event.client_payload.tag }}" | |
| } |