8000 Merge pull request #10 from DNNCommunity/github-token-v2 · DNNCommunity/Dnn.ModuleCreator@2df1462 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2df1462

Browse files
authored
Merge pull request #10 from DNNCommunity/github-token-v2
Changed how githubtoken is obtained and added logging
2 parents 0542144 + 5e8ee31 commit 2df1462

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

build/Build.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class Build : NukeBuild
5252
readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
5353

5454
[Parameter("Github Token")]
55-
readonly string GithubToken;
55+
readonly string GithubToken = Environment.GetEnvironmentVariable("github-token");
5656

5757
[Solution] readonly Solution Solution;
5858
[GitRepository] readonly GitRepository GitRepository;
@@ -77,12 +77,10 @@ class Build : NukeBuild
7777
.Before(Package)
7878
.Executes(() =>
7979
{
80-
using (var block = Logger.Block("Info"))
81-
{
82-
Logger.Normal(Configuration);
83-
}
8480
InstallFiles = GlobFiles(RootDirectory, "*.txt", "*.dnn");
81+
Logger.Normal($"Found install files: {Helpers.Dump(InstallFiles)}");
8582
IsInDesktopModules = RootDirectory.Parent.ToString().EndsWith("DesktopModules");
83+
Logger.Normal(IsInDesktopModules ? "We are" : "We are not" + " in a DesktopModules folder.");
8684
});
8785

8886
Target Clean => _ => _
@@ -92,6 +90,7 @@ class Build : NukeBuild
9290
.Executes(() =>
9391
{
9492
EnsureCleanDirectory(ArtifactsDirectory);
93+
Logger.Normal($"Cleaned {ArtifactsDirectory}");
9594
});
9695

9796
Target Restore => _ => _
@@ -173,6 +172,8 @@ class Build : NukeBuild
173172
Logger.Info($"We are on branch {ModuleBranch}");
174173
if (ModuleBranch == "main" || ModuleBranch.StartsWith("release"))
175174
{
175+
Logger.Normal("GithubToken is " + (string.IsNullOrWhiteSpace(GithubToken) ? "empty" : "present"));
176+
Logger.Normal($"GitRepository is: {Helpers.Dump(GitRepository)}");
176177
owner = GitRepository.Identifier.Split('/')[0];
177178
name = GitRepository.Identifier.Split('/')[1];
178179
gitHubClient = new GitHubClient(new ProductHeaderValue("Nuke"));
@@ -198,6 +199,7 @@ class Build : NukeBuild
198199
TargetCommitish = GitVersion.Sha,
199200
Prerelease = ModuleBranch.StartsWith("release")
200201
};
202+
Logger.Normal($"newRelease is : {Helpers.Dump(newRelease)}");
201203
release = gitHubClient.Repository.Release.Create(owner, name, newRelease).Result;
202204
Logger.Info($"{release.Name} released !");
203205

0 commit comments

Comments
 (0)
0