Skip to content

Commit

Permalink
Merge pull request #1 from digitalrmdy/feature/open_source_preparation
Browse files Browse the repository at this point in the history
open source preparation
  • Loading branch information
MaximST92 authored Dec 3, 2024
2 parents e56b568 + c0db6a6 commit d31b7e6
Show file tree
Hide file tree
Showing 17 changed files with 153 additions and 219 deletions.
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

0 comments on commit d31b7e6

Please sign in to comment.