-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (116 loc) · 4.17 KB
/
update-dotnet-sdks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
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