private Release CreateRelease(GitHubClient gitHubClient, Repository gitHubRepo, GitClient gitClient, string repoName) { var headCommit = gitClient.GetHeadCommit().Sha; string changelog; using (new WorkingDirectoryScope(gitClient.RepositoryPath)) { changelog = GetReleaseNotesFromChangeLog(); } string name; string preamble; switch (repoName) { case "gdk-for-unity": name = $"GDK for Unity Alpha Release {options.Version}"; preamble = @"In this release, we've ... We've also fixed ... Keep giving us your feedback and/or suggestions! Check out [our Discord](https://discord.gg/SCZTCYm), [our forums](https://forums.improbable.io/), or here in the [Github issues](https://github.com/spatialos/gdk-for-unity/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)! See the full release notes below! 👇"; break; case "gdk-for-unity-fps-starter-project": name = $"GDK for Unity FPS Starter Project Alpha Release {options.Version}"; preamble = $@"This release of the FPS Starter Project is intended for use with the GDK for Unity Alpha Release {options.Version}. Keep giving us your feedback and/or suggestions! Check out [our Discord](https://discord.gg/SCZTCYm), [our forums](https://forums.improbable.io/), or here in the [Github issues](https://github.com/spatialos/gdk-for-unity/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)!"; break; case "gdk-for-unity-blank-project": name = $"GDK for Unity Blank Project Alpha Release {options.Version}"; preamble = $@"This release of the Blank Project is intended for use with the GDK for Unity Alpha Release {options.Version}. Keep giving us your feedback and/or suggestions! Check out [our Discord](https://discord.gg/SCZTCYm), [our forums](https://forums.improbable.io/), or here in the [Github issues](https://github.com/spatialos/gdk-for-unity/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)!"; break; default: throw new ArgumentException("Unsupported repository.", nameof(repoName)); } var releaseBody = $@"{preamble} --- {changelog}"; return(gitHubClient.CreateDraftRelease(gitHubRepo, options.Version, releaseBody, name, headCommit)); }
private void FinalizeRelease(GitHubClient gitHubClient, GitClient gitClient, Repository gitHubRepo, string gitRepoName, string repoUrl) { // This uploads the commit hashes of the merge into release. // When run against UnrealGDK, the UnrealEngine hashes are used to update the unreal-engine.version file to include the UnrealEngine release commits. BuildkiteAgent.SetMetaData(options.ReleaseBranch, gitClient.GetHeadCommit().Sha); // TODO: UNR-3615 - Fix this so it does not throw Octokit.ApiValidationException: Reference does not exist. // Delete candidate branch. //gitHubClient.DeleteBranch(gitHubClient.GetRepositoryFromUrl(repoUrl), options.CandidateBranch); var release = CreateRelease(gitHubClient, gitHubRepo, gitClient, gitRepoName); BuildkiteAgent.Annotate(AnnotationLevel.Info, "draft-releases", string.Format(releaseAnnotationTemplate, release.HtmlUrl, gitRepoName), true); Logger.Info("Release Successful!"); Logger.Info("Release hash: {0}", gitClient.GetHeadCommit().Sha); Logger.Info("Draft release: {0}", release.HtmlUrl); CreatePRFromReleaseToSource(gitHubClient, gitHubRepo, repoUrl, gitRepoName, gitClient); }
private Release CreateRelease(GitHubClient gitHubClient, Repository gitHubRepo, GitClient gitClient, string repoName) { var headCommit = gitClient.GetHeadCommit().Sha; var engineVersion = options.SourceBranch.Trim(); string name; string releaseBody; switch (repoName) { case "UnrealGDK": string changelog; using (new WorkingDirectoryScope(gitClient.RepositoryPath)) { changelog = GetReleaseNotesFromChangeLog(); } name = $"GDK for Unreal Release {options.Version}"; releaseBody = $@"The release notes are published in both English and Chinese. To view the Chinese version, scroll down a bit for details. Thanks! Release notes 将同时提供中英文。要浏览中文版本,向下滚动页面查看详情。感谢! # English version **Unreal GDK version {options.Version} is go!** ## Release Notes * **Release sheriff:** Your human labour is required to populate this section with the headline new features and breaking changes from the CHANGELOG. ## Upgrading * You can find the corresponding UnrealEngine version(s) [here](https://github.com/improbableio/UnrealEngine/releases). * You can find the corresponding UnrealGDKExampleProject version [here](https://github.com/spatialos/UnrealGDKExampleProject/releases). Follow **[these](https://documentation.improbable.io/gdk-for-unreal/docs/keep-your-gdk-up-to-date)** steps to upgrade your GDK, Engine fork and Example Project to the latest release. You can read the full release notes [here](https://github.com/spatialos/UnrealGDK/blob/release/CHANGELOG.md) or below. Join the community on our [forums](https://forums.improbable.io/), or on [Discord](https://discordapp.com/invite/vAT7RSU). Happy developing, *The GDK team* --- {changelog} # 中文版本 **[虚幻引擎开发套件 (GDK) {options.Version} 版本已发布!** ## Release Notes * **Tech writer:** Your human labour is required to translate the above and include it here. "; break; case "UnrealEngine": name = $"{engineVersion}-{options.Version}"; releaseBody = $@"Unreal GDK version {options.Version} is go! * This Engine version corresponds to GDK version: [{options.Version}](https://github.com/spatialos/UnrealGDK/releases). * You can find the corresponding UnrealGDKExampleProject version [here](https://github.com/spatialos/UnrealGDKExampleProject/releases). Follow [these steps](https://documentation.improbable.io/gdk-for-unreal/docs/keep-your-gdk-up-to-date) to upgrade your GDK, Unreal Engine fork and your Project to the latest release. You can read the full release notes [here](https://github.com/spatialos/UnrealGDK/blob/release/CHANGELOG.md). Join the community on our [forums](https://forums.improbable.io/), or on [Discord](https://discordapp.com/invite/vAT7RSU). Happy developing!<br> GDK team"; break; case "UnrealGDKTestGyms": name = $"{options.Version}"; releaseBody = $@"Unreal GDK version {options.Version} is go! * This UnrealGDKTestGyms version corresponds to GDK version: [{options.Version}](https://github.com/spatialos/UnrealGDK/releases). * You can find the corresponding UnrealGDKExampleProject version [here](https://github.com/spatialos/UnrealGDKExampleProject/releases). * You can find the corresponding UnrealEngine version(s) [here](https://github.com/improbableio/UnrealEngine/releases). Follow [these steps](https://documentation.improbable.io/gdk-for-unreal/docs/keep-your-gdk-up-to-date) to upgrade your GDK, Unreal Engine fork and your Project to the latest release. You can read the full release notes [here](https://github.com/spatialos/UnrealGDK/blob/release/CHANGELOG.md). Join the community on our [forums](https://forums.improbable.io/), or on [Discord](https://discordapp.com/invite/vAT7RSU). Happy developing!<br> GDK team"; break; case "UnrealGDKEngineNetTest": name = $"{options.Version}"; releaseBody = $@"Unreal GDK version {options.Version} is go! * This UnrealGDKEngineNetTest version corresponds to GDK version: [{options.Version}](https://github.com/spatialos/UnrealGDK/releases). * You can find the corresponding UnrealGDKTestGyms version [here](https://github.com/improbable/UnrealGDKTestGyms/releases). * You can find the corresponding UnrealGDKExampleProject version [here](https://github.com/spatialos/UnrealGDKExampleProject/releases). * You can find the corresponding UnrealEngine version(s) [here](https://github.com/improbableio/UnrealEngine/releases). Follow [these steps](https://documentation.improbable.io/gdk-for-unreal/docs/keep-your-gdk-up-to-date) to upgrade your GDK, Unreal Engine fork and your Project to the latest release. You can read the full release notes [here](https://github.com/spatialos/UnrealGDK/blob/release/CHANGELOG.md). Join the community on our [forums](https://forums.improbable.io/), or on [Discord](https://discordapp.com/invite/vAT7RSU). Happy developing!<br> GDK team"; break; case "TestGymBuildKite": name = $"{options.Version}"; releaseBody = $@"Unreal GDK version {options.Version} is go! * This TestGymBuildKite version corresponds to GDK version: [{options.Version}](https://github.com/spatialos/UnrealGDK/releases). * You can find the corresponding UnrealGDKTestGyms version [here](https://github.com/improbable/UnrealGDKTestGyms/releases). * You can find the corresponding UnrealGDKExampleProject version [here](https://github.com/spatialos/UnrealGDKExampleProject/releases). * You can find the corresponding UnrealEngine version(s) [here](https://github.com/improbableio/UnrealEngine/releases). Follow [these steps](https://documentation.improbable.io/gdk-for-unreal/docs/keep-your-gdk-up-to-date) to upgrade your GDK, Unreal Engine fork and your Project to the latest release. You can read the full release notes [here](https://github.com/spatialos/UnrealGDK/blob/release/CHANGELOG.md). Join the community on our [forums](https://forums.improbable.io/), or on [Discord](https://discordapp.com/invite/vAT7RSU). Happy developing!<br> GDK team"; break; case "UnrealGDKExampleProject": name = $"{options.Version}"; releaseBody = $@"Unreal GDK version {options.Version} is go! * This UnrealGDKExampleProject version corresponds to GDK version: [{options.Version}](https://github.com/spatialos/UnrealGDK/releases). * You can find the corresponding UnrealEngine version(s) [here](https://github.com/improbableio/UnrealEngine/releases). Follow [these steps](https://documentation.improbable.io/gdk-for-unreal/docs/keep-your-gdk-up-to-date) to upgrade your GDK, Unreal Engine fork and your Project to the latest release. You can read the full release notes [here](https://github.com/spatialos/UnrealGDK/blob/release/CHANGELOG.md). Join the community on our [forums](https://forums.improbable.io/), or on [Discord](https://discordapp.com/invite/vAT7RSU). Happy developing!<br> GDK team"; break; default: throw new ArgumentException("Unsupported repository.", nameof(repoName)); } return(gitHubClient.CreateDraftRelease(gitHubRepo, options.Version, releaseBody, name, headCommit)); }