Skip to content

Commit

Permalink
chore: Minor Dotty tweak (#2946)
Browse files Browse the repository at this point in the history
  • Loading branch information
tippmar-nr authored Jan 13, 2025
1 parent 88b613a commit 655b872
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 16 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/build_buildtools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build the Build Tools solution

on:
pull_request:
branches:
- main
paths:
- 'build/**'
- '.github/workflows/scripts/**'

workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2

- name: Add msbuild to PATH (required for MsiInstaller build)
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0

- name: Build the solution
run: MSBuild.exe -restore -m -p:Configuration=Release -p:Platform="Any CPU" build/BuildTools.sln
16 changes: 5 additions & 11 deletions .github/workflows/scripts/nugetSlackNotifications/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,25 +256,19 @@ static async Task<string> CreateGithubPullRequestForNewVersions(IEnumerable<Proj
});
}

var newTree = await ghClient.Git.Tree.Create(Owner, Repo, nt);
var commitMessage = "test:Dotty instrumentation library updates for " + DateTime.Now.ToString("yyyy-MMM-dd");
var newCommit = new NewCommit(commitMessage, newTree.Sha, masterReference.Object.Sha);
var commit = await ghClient.Git.Commit.Create(Owner, Repo, newCommit);
var branchref = await ghClient.Git.Reference.Update(Owner, Repo, $"heads/{branchName}", new ReferenceUpdate(commit.Sha));
var commitMessage = "test: Dotty instrumentation library updates for " + DateTime.Now.ToString("yyyy-MMM-dd");
Log.Information($"Successfully created {branchName} branch.");

var newPr = new NewPullRequest(commitMessage, branchName, "main");
newPr.Body = "Dotty updated the following for your convenience.\n\n" + updateLog;
newPr.Body = "Dotty updated the following for your convenience.\n\n" + updateLog + "\n\n**Don't forget to update the .NET Compatibility docs:docs: with the new versions!**\n";
var pullRequest = await ghClient.PullRequest.Create(Owner, Repo, newPr);
Log.Information($"Successfully created PR for {branchName} at {pullRequest.HtmlUrl}");

return pullRequest.HtmlUrl;
}
else
{
Log.Information($"Pull request will not be created: # of new versions={_newVersions.Count}, token available={_webhook != null}, test mode={_testMode}");
return "";
}

Log.Information($"Pull request will not be created: # of new versions={_newVersions.Count}, token available={_webhook != null}, test mode={_testMode}");
return "";
}

[Trace]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand All @@ -25,8 +25,4 @@
</None>
</ItemGroup>

<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>

</Project>

0 comments on commit 655b872

Please sign in to comment.