update-dotnet-sdks #216
This file contains 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: update-dotnet-sdks | |
on: | |
repository_dispatch: | |
types: [ dotnet_release ] | |
schedule: | |
- cron: '00 19 * * TUE' | |
workflow_call: | |
inputs: | |
branch: | |
description: 'The branch to run the SDK updates for.' | |
required: true | |
type: string | |
repository: | |
description: 'An optional single repository to update.' | |
required: false | |
type: string | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'The branch to run the SDK updates for.' | |
required: false | |
type: choice | |
options: | |
- 'main' | |
- 'dotnet-vnext' | |
- 'dotnet-nightly' | |
default: 'main' | |
repository: | |
description: 'An optional single repository to update.' | |
required: false | |
type: string | |
default: '' | |
permissions: {} | |
jobs: | |
get-repos: | |
runs-on: [ ubuntu-latest ] | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: false | |
outputs: | |
updates: ${{ steps.get-repos.outputs.updates }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Get repositories to update | |
uses: ./actions/get-sdk-repos | |
id: get-repos | |
with: | |
branch: ${{ (github.event.client_payload && github.event.client_payload.branch) || inputs.branch || '' }} | |
github-token: ${{ secrets.COSTELLOBOT_TOKEN }} | |
nightly-channel: ${{ vars.DOTNET_NIGHTLY_CHANNEL }} | |
prerelease-label: ${{ vars.DOTNET_PRERELEASE_LABEL }} | |
repository: ${{ inputs.repository || '' }} | |
update-sdk: | |
name: 'update-${{ matrix.repo }}' | |
needs: [ get-repos ] | |
if: needs.get-repos.outputs.updates != '[]' | |
uses: martincostello/update-dotnet-sdk/.github/workflows/update-dotnet-sdk.yml@0bc908ef15be678a94bc7bf92f742bbaff67337e # v3.3.0 | |
concurrency: | |
group: 'update-sdk-${{ matrix.repo }}' | |
cancel-in-progress: false | |
strategy: | |
fail-fast: false | |
max-parallel: 3 | |
matrix: | |
include: ${{ fromJSON(needs.get-repos.outputs.updates) }} | |
with: | |
channel: ${{ matrix.channel }} | |
exclude-nuget-packages: ${{ matrix.exclude-nuget-packages }} | |
include-nuget-packages: ${{ matrix.include-nuget-packages }} | |
labels: ${{ matrix.labels }} | |
nuget-packages-prerelease-label: ${{ matrix.dotnet-prerelease-label }} | |
quality: ${{ matrix.quality }} | |
ref: ${{ matrix.ref }} | |
repo: ${{ matrix.repo }} | |
sdk-prerelease-label: ${{ matrix.dotnet-prerelease-label }} | |
update-nuget-packages: ${{ matrix.update-nuget-packages }} | |
user-email: ${{ vars.GIT_COMMIT_USER_EMAIL }} | |
user-name: ${{ vars.GIT_COMMIT_USER_NAME }} | |
secrets: | |
repo-token: ${{ secrets.COSTELLOBOT_TOKEN }} | |
update-sdk-external: | |
runs-on: [ ubuntu-latest ] | |
if: inputs.repository == '' | |
concurrency: | |
group: '${{ github.workflow }}-external' | |
cancel-in-progress: false | |
steps: | |
- name: Update .NET SDKs | |
shell: pwsh | |
env: | |
BRANCH_NAME: ${{ (github.event.client_payload && github.event.client_payload.branch) || inputs.branch || 'main' }} | |
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
run: | | |
$branch = $env:BRANCH_NAME | |
$repos = @( | |
"App-vNext/Polly", | |
"aspnet-contrib/AspNet.Security.OAuth.Providers", | |
"aspnet-contrib/AspNet.Security.OpenId.Providers", | |
"domaindrivendev/Swashbuckle.AspNetCore", | |
"justeattakeaway/ApplePayJSSample", | |
"justeattakeaway/AwsWatchman", | |
"justeattakeaway/httpclient-interception", | |
"justeattakeaway/JustEat.StatsD", | |
"justeattakeaway/JustSaying" | |
) | |
foreach ($repo in $repos) { | |
gh api "repos/${repo}/branches/${branch}" 2> $null | Out-Null | |
if ($LASTEXITCODE -ne 0) { | |
Write-Output "::Debug::Skipping ${repo} as the ${branch} branch does not exist." | |
continue | |
} | |
gh workflow run "update-dotnet-sdk.yml" --ref $branch --repo $repo | |
Start-Sleep -Seconds 10 # Wait 10 seconds to prevent issues with GitHub secondary rate limits | |
} | |
exit 0 |