⚠️ This guide is still a work in progress.
The workflows in this repository are used to help make it easier to test .NET applications in GitHub repositories with the latest previews of the next major version of .NET.
- The changes are tested in a branch named
dotnet-vnext. - The application code has already applied one manual update to the test .NET SDK version and has updated package references, Target Framework Monikers etc. to use that version.
- A draft pull request has been opened to merge the
dotnext-vnextinto the default branch. - A
global.jsonfile that specifies the .NET SDK version to use is present in the root of the repository. - Branch protections are enabled on the
dotnext-vnextbranch to:- Require a pull request
- Require the same status checks to pass as the default branch
- Allow force pushes to that branch from the users/apps that are used to update the branch
- If the account used to force push the changes is not an owner of the repositories being updated, then you will need to assign the app/user (or a the team it belongs to) a custom repository role that has the Bypass branch protections permission in addition to write access.
- The only files in the repository containing versions that need updating regularly are:
global.json.csprojfilespackage.jsonfiles
- Run
update-dotnet-sdksfor themainbranch on Patch Tuesday. - Wait for any pull requests generated by the workflow(s) to be merged.
- Run
rebasefor thedotnet-vnextbranch. - Check whether any repositories require manual rebasing.
- 💡 If so, you can use Rebaser to simplify this.
- Run
update-dotnet-sdksfor thedotnet-vnextbranch.
The dotnet-upgrade-report workflow can be used to
generate a report of the .NET SDK versions used in the repositories configured
in the workflow. This will show a link to the upgrade pull requests, the SDK
version used in the dotnet-vnext branch, the status of the build and whether there
are any conflicts that need resolving in order to merge to the default branch.
sequenceDiagram
autonumber
title Update .NET vNext to latest preview
actor user as .NET team
participant dotnet as dotnet/core
participant release as martincostello/github-automation<br>dotnet-release.yml
participant automation as martincostello/github-automation
participant update-all as martincostello/github-automation<br>update-dotnet-sdks.yml
participant update-one as martincostello/*<br>update-dotnet-sdk.yml
participant repo as martincostello/*
participant build as martincostello/*<br>build.yml
participant bot as costellobot
participant rebase as martincostello/github-automation<br>rebase.yml
note over repo: .NET SDK<br>7.0.100<br>@main
note over repo: .NET SDK<br>8.0.100-preview.n<br>@dotnet-vnext
user -) dotnet: Push release-notes/**/releases.json
note over release: Poll for changes to<br>dotnet/core@main
loop */15 08-22 * * MON-FRI
activate release
release ->>+ dotnet: Get main branch
dotnet -->>- release: git_sha
alt git_sha != DOTNET_CORE_SHA
release ->>+ dotnet: Compare DOTNET_CORE_SHA...git_sha
dotnet -->>- release: diff
release ->> repo: Update DOTNET_CORE_SHA
alt diff contains changes to<br>release-notes/**/releases.json
release -) automation: repository_dispatch:dotnet_release
end
end
deactivate release
end
automation -) update-all: repository_dispatch:dotnet_release
note over update-all: Run update-dotnet-sdk<br>for available repositories
activate update-all
loop repository
alt Branch exists and global.json exists
update-all ->>+ repo: Get .github/update-dotnet-sdk.json
repo -->>- update-all: Update configuration
update-all -) update-one: workflow_call
end
end
deactivate update-all
par In each GitHub repository
note over update-one: Check for .NET SDK update
activate update-one
update-one ->>+ dotnet: Get release-notes/x.x/releases.json
dotnet -->>- update-one: Release notes
alt New version of .NET SDK<br>compared to global.json?
update-one ->> repo: Update global.json and push branch
update-one ->> repo: Open pull request
end
deactivate update-one
note over repo: .NET SDK<br>7.0.101<br>@update-dotnet-sdk
repo -) build: pull_request
activate build
note over build: Run CI for pull request
alt CI successful?
build ->> repo: Merge pull request
end
deactivate build
note over repo: .NET SDK<br>7.0.101<br>@main
note over repo: Merge conflict<br>in global.json
repo -) bot: push
activate bot
alt Was global.json updated?
bot -) automation: repository_dispatch:dotnet_dependencies_updated
end
deactivate bot
automation -) rebase: repository_dispatch:dotnet_dependencies_updated
activate rebase
note over rebase: Rebase dotnet-vnext
rebase ->>+ repo: Force push dotnet-vnext branch
deactivate rebase
note over repo: .NET SDK<br>8.0.100-preview.n<br>@dotnet-vnext
end