Skip to content

Commit

Permalink
Rename NuGet parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
ricaun committed Jan 19, 2025
1 parent 636ed1f commit 12104f6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
env:
GitHubToken: ${{ secrets.GITHUB_TOKEN }}

NugetApiUrl: ${{ secrets.NUGET_API_URL }}
NugetApiKey: ${{ secrets.NUGET_API_KEY }}
NuGetApiUrl: ${{ secrets.NUGET_API_URL }}
NuGetApiKey: ${{ secrets.NUGET_API_KEY }}

SignFile: ${{ secrets.SIGN_FILE }}
SignPassword: ${{ secrets.SIGN_PASSWORD }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ The `TimestampUrl` and `TimestampDigest` are optional.

The `SIGN_PASSWORD_AZURE` is the `AzureKeyVaultClientSecret` of the `Azure Key Vault` certificate.

### Publish Package Nuget
### Publish Package NuGet

```yml
env:
GitHubToken: ${{ secrets.GITHUB_TOKEN }}
SignFile: ${{ secrets.SIGN_FILE }}
SignPassword: ${{ secrets.SIGN_PASSWORD }}
NugetApiUrl: ${{ secrets.NUGET_API_URL }}
NugetApiKey: ${{ secrets.NUGET_API_KEY }}
NuGetApiUrl: ${{ secrets.NUGET_API_URL }}
NuGetApiKey: ${{ secrets.NUGET_API_KEY }}
```

# Build.cs - ITest
Expand Down
14 changes: 7 additions & 7 deletions ricaun.Nuke/Components/IHazPack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ namespace ricaun.Nuke.Components
public interface IHazPack : IHazGitRepository, INukeBuild
{
/// <summary>
/// NugetApiUrl
/// NuGetApiUrl
/// </summary>
[Secret][Parameter] public string NugetApiUrl => TryGetValue(() => NugetApiUrl) ?? GetGitRepositoryPackageUrl();
[Secret][Parameter] public string NuGetApiUrl => TryGetValue(() => NuGetApiUrl) ?? GetGitRepositoryPackageUrl();
/// <summary>
/// NugetApiKey
/// NuGetApiKey
/// </summary>
[Secret][Parameter] public string NugetApiKey => TryGetValue(() => NugetApiKey) ?? GitHubToken;
[Secret][Parameter] public string NuGetApiKey => TryGetValue(() => NuGetApiKey) ?? GitHubToken;

/// <summary>
/// DotNetNuGetPush
/// </summary>
/// <param name="packageFilePath"></param>
void DotNetNuGetPush(AbsolutePath packageFilePath)
{
NuGetExtension.DotNetNuGetPush(NugetApiUrl, NugetApiKey, packageFilePath);
NuGetExtension.DotNetNuGetPush(NuGetApiUrl, NuGetApiKey, packageFilePath);
}

/// <summary>
Expand All @@ -35,8 +35,8 @@ void DotNetNuGetPush(AbsolutePath packageFilePath)
void DotNetNuGetPrerelease(AbsolutePath packageFilePath)
{
var packageNameVersion = packageFilePath.Name;
NuGetExtension.DotNetNuGetPush(NugetApiUrl, NugetApiKey, packageFilePath);
NuGetExtension.NuGetUnlist(NugetApiUrl, NugetApiKey, packageNameVersion);
NuGetExtension.DotNetNuGetPush(NuGetApiUrl, NuGetApiKey, packageFilePath);
NuGetExtension.NuGetUnlist(NuGetApiUrl, NuGetApiKey, packageNameVersion);
}

/// <summary>
Expand Down
10 changes: 5 additions & 5 deletions ricaun.Nuke/Components/IPack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ namespace ricaun.Nuke.Components
public interface IPack : IHazPack, IGitRelease
{
/// <summary>
/// UnlistNuget (Default: false)
/// UnlistNuGet (Default: false)
/// </summary>
/// <remarks>This feature only works on 'api.nuget.org' to unlist package.</remarks>
[Parameter]
bool UnlistNuget => TryGetValue<bool?>(() => UnlistNuget) ?? false;
bool UnlistNuGet => TryGetValue<bool?>(() => UnlistNuGet) ?? false;

/// <summary>
/// Target Pack
/// </summary>
Target Pack => _ => _
.TriggeredBy(Release)
.After(GitRelease)
.OnlyWhenStatic(() => NugetApiUrl.SkipEmpty())
.OnlyWhenStatic(() => NugetApiKey.SkipEmpty())
.OnlyWhenStatic(() => NuGetApiUrl.SkipEmpty())
.OnlyWhenStatic(() => NuGetApiKey.SkipEmpty())
.OnlyWhenStatic(() => IsServerBuild)
.OnlyWhenDynamic(() => GitRepository.IsOnMainOrMasterBranch())
.OnlyWhenDynamic(() => SkipForked())
Expand All @@ -35,7 +35,7 @@ public interface IPack : IHazPack, IGitRelease
var releaseDirectory = GetReleaseDirectory(MainProject);
var packages = Globbing.GlobFiles(releaseDirectory, "**/*.nupkg");

if (UnlistNuget)
if (UnlistNuGet)
{
packages.ForEach(DotNetNuGetPrerelease);
return;
Expand Down
4 changes: 2 additions & 2 deletions ricaun.Nuke/Components/IPrePack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public interface IPrePack : IPack, IGitPreRelease
.TriggeredBy(Release)
.After(Pack)
.After(GitPreRelease)
.OnlyWhenStatic(() => NugetApiUrl.SkipEmpty())
.OnlyWhenStatic(() => NugetApiKey.SkipEmpty())
.OnlyWhenStatic(() => NuGetApiUrl.SkipEmpty())
.OnlyWhenStatic(() => NuGetApiKey.SkipEmpty())
.OnlyWhenStatic(() => IsServerBuild)
.OnlyWhenDynamic(() => GitRepository.IsOnDevelopBranch())
.OnlyWhenDynamic(() => SkipForked())
Expand Down

0 comments on commit 12104f6

Please sign in to comment.