Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open source preparation #1

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# ------------------------------------------------------------------------------
# <auto-generated>
#
# This code was generated.
#
# - To turn off auto-generation set:
#
# [GitHubActions (AutoGenerate = false)]
#
# - To trigger manual generation invoke:
#
# nuke --generate-configuration GitHubActions_pr --host GitHubActions
#
# </auto-generated>
# ------------------------------------------------------------------------------

name: pr

on: [pull_request]

jobs:
ubuntu-latest:
name: ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 'Run: Pack'
run: ./build.cmd Pack
- name: 'Publish: artifacts'
uses: actions/upload-artifact@v4
with:
name: artifacts
path: artifacts
40 changes: 40 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# ------------------------------------------------------------------------------
# <auto-generated>
#
# This code was generated.
#
# - To turn off auto-generation set:
#
# [GitHubActions (AutoGenerate = false)]
#
# - To trigger manual generation invoke:
#
# nuke --generate-configuration GitHubActions_publish --host GitHubActions
#
# </auto-generated>
# ------------------------------------------------------------------------------

name: publish

on:
push:
tags:
- '*.*.*'

jobs:
ubuntu-latest:
name: ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 'Run: Publish'
run: ./build.cmd Publish
env:
NugetApiKey: ${{ secrets.NUGET_API_KEY }}
- name: 'Publish: artifacts'
uses: actions/upload-artifact@v4
with:
name: artifacts
path: artifacts
4 changes: 0 additions & 4 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="RMDY-AzureArtifacts" value="https://pkgs.dev.azure.com/Growandglow/dotRMDY/_packaging/dotRMDY/nuget/v3/index.json" />
</packageSources>
<packageSourceMapping>
<clear />
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
<packageSource key="RMDY-AzureArtifacts">
<package pattern="dotRMDY.*" />
</packageSource>
</packageSourceMapping>
</configuration>
23 changes: 0 additions & 23 deletions azure-pipelines.Dependabot.yml

This file was deleted.

41 changes: 0 additions & 41 deletions azure-pipelines.PR.yml

This file was deleted.

39 changes: 0 additions & 39 deletions azure-pipelines.Publish.yml

This file was deleted.

49 changes: 0 additions & 49 deletions build/Build.CI.AzurePipelines.cs

This file was deleted.

20 changes: 20 additions & 0 deletions build/Build.CI.GithubActions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Nuke.Common.CI.GitHubActions;

[GitHubActions(
"pr",
GitHubActionsImage.UbuntuLatest,
On = [GitHubActionsTrigger.PullRequest],
InvokedTargets = [nameof(Pack)],
AutoGenerate = false,
FetchDepth = 0,
CacheKeyFiles = [])]
[GitHubActions(
"publish",
GitHubActionsImage.UbuntuLatest,
InvokedTargets = [nameof(Publish)],
AutoGenerate = false,
FetchDepth = 0,
CacheKeyFiles = [],
OnPushTags = ["'*.*.*'"],
ImportSecrets = [nameof(NugetApiKey)])]
partial class Build;
37 changes: 0 additions & 37 deletions build/Build.Feeds.DotRmdyAzureArtifacts.cs

This file was deleted.

38 changes: 38 additions & 0 deletions build/Build.Feeds.NugetDotOrg.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System.Collections.Generic;
using Nuke.Common;
using Nuke.Common.CI.AzurePipelines;
using Nuke.Common.IO;
using Nuke.Common.Tooling;
using Nuke.Common.Tools.DotNet;
using Nuke.Common.Utilities.Collections;
using Serilog;
using static Nuke.Common.Tools.DotNet.DotNetTasks;

partial class Build
{
[Secret, Parameter] string NugetApiKey;
[Parameter] string NugetSource = "https://api.nuget.org/v3/index.json";

Target PublishToNugetOrg => _ => _
.DependsOn(Pack)
.Requires(() => NugetSource)
.Requires(() => NugetApiKey)
.Executes(() =>
{
IEnumerable<AbsolutePath> artifactPackages = ArtifactsDirectory.GlobFiles("*.nupkg");
if (artifactPackages.IsNullOrEmpty())
{
Log.Warning("No packages found to push to NuGet.org");
return;
}

artifactPackages.ForEach(x =>
{
Log.Information("Pushing {Path} to NuGet.org", x);
DotNetNuGetPush(s => s
.SetSource(NugetSource)
.SetApiKey(NugetApiKey)
.SetTargetPath(x));
});
});
}
7 changes: 1 addition & 6 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ partial class Build : NukeBuild
});

Target Restore => _ => _
.DependsOn(UpdateFeedCredentials)
.Executes(() =>
{
DotNetRestore(s => s
Expand All @@ -59,10 +58,6 @@ partial class Build : NukeBuild
.EnableContinuousIntegrationBuild());
});

Target UpdateFeedCredentials => _ => _
.Unlisted()
.DependsOn(UpdateDotRmdyAzureArtifactsFeedCredentials);

Target Compile => _ => _
.DependsOn(Restore)
.Executes(() =>
Expand Down Expand Up @@ -118,5 +113,5 @@ partial class Build : NukeBuild
});

Target Publish => _ => _
.DependsOn(PublishToDotRmdyAzureArtifacts);
.DependsOn(PublishToNugetOrg);
}
4 changes: 2 additions & 2 deletions build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace />
<NoWarn>CS0649;CS0169</NoWarn>
<NukeRootDirectory>..</NukeRootDirectory>
Expand All @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nuke.Common" Version="7.0.6" />
<PackageReference Include="Nuke.Common" Version="9.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading
Loading