Skip to content

dotnet_release

dotnet_release #161

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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- 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@67d6e2b14939c06978a7f80444157296c3defe14 # v3.2.3
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.nuget-packages-prerelease-label }}
quality: ${{ matrix.quality }}
ref: ${{ matrix.ref }}
repo: ${{ matrix.repo }}
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