Skip to content

Commit

Permalink
Removing github token
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Renaud committed Dec 7, 2021
1 parent 951e9b5 commit 70ae7da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 29 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:
Expand All @@ -23,7 +22,6 @@ jobs:
dotnet-version: 5.0.x

- name: Nuke
run: ./build.sh publish --github-token $GITHUB_TOKEN --nuget-api-key $NUGET_AUTH_TOKEN
run: ./build.sh publish --nuget-api-key $NUGET_AUTH_TOKEN
env:
NUGET_AUTH_TOKEN: ${{secrets.NUGET_API_KEY}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30 changes: 4 additions & 26 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ class Build : NukeBuild
[Parameter]
readonly string NugetApiKey;

[Parameter]
readonly string GitHubToken;

[Solution] readonly Solution Solution;
[GitRepository] readonly GitRepository GitRepository;
[GitVersion(Framework = "netcoreapp3.1", UpdateBuildNumber = true)] readonly GitVersion GitVersion;
Expand Down Expand Up @@ -95,28 +92,9 @@ class Build : NukeBuild
.DependsOn(Pack)
.Executes(() =>
{
if (GitRepository.IsOnDevelopBranch() || GitRepository.IsOnReleaseBranch())
{
DotNetNuGetPush(p => p
.SetTargetPath(OutputDirectory / "*.nupkg")
.SetSource("https://nuget.pkg.github.com/rena0157/index.json")
.SetApiKey(GitHubToken));
}
else if (GitRepository.Branch?.EqualsOrdinalIgnoreCase("main") ?? false)
{
DotNetNuGetPush(p => p
.SetTargetPath(OutputDirectory / "*.nupkg")
.SetSource("https://api.nuget.org/v3/index.json")
.SetApiKey(NugetApiKey));

DotNetNuGetPush(p => p
.SetTargetPath(OutputDirectory / "*.nupkg")
.SetSource("https://nuget.pkg.github.com/rena0157/index.json")
.SetApiKey(GitHubToken));
}
else
{
Logger.Log(LogLevel.Normal, "No packages where released");
}
DotNetNuGetPush(p => p
.SetTargetPath(OutputDirectory / "*.nupkg")
.SetSource("https://api.nuget.org/v3/index.json")
.SetApiKey(NugetApiKey));
});
}

0 comments on commit 70ae7da

Please sign in to comment.