Compare commits

...

2 Commits

Author SHA1 Message Date
ae766c70cb reverted the sln so it won't crash Rider
Some checks failed
CI Build / CI Build API (pull_request) Failing after 31s
2025-01-22 10:34:34 -07:00
e6d2c8ac37 added gitea pipeline 2025-01-22 09:34:13 -07:00
2 changed files with 66 additions and 4 deletions

View File

@ -0,0 +1,52 @@
name: CI Build
on:
push:
branches: [ master ]
paths-ignore:
- '**/*.md'
- '**/*.gitignore'
- '**/*.gitattributes'
pull_request:
branches: [ master ]
workflow_dispatch:
permissions:
contents: write
packages: write
env:
DOTNET_NOLOGO: true # Disable the .NET logo
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience
DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry
MINOR_VERSION_OVERRIDE: 0
GITEA_SERVER_URL: ${{ secrets.S_GITEA_SERVER_URL }}
GITEA_PACKAGE_OWNER: ${{ secrets.S_GITEA_PACKAGE_OWNER }}
GITEA_PACKAGE_OWNER_USER: ${{ secrets.S_GITEA_PACKAGE_OWNER_USER }}
GITEA_PACKAGE_OWNER_PASSWORD: ${{ secrets.S_GITEA_PACKAGE_OWNER_PASSWORD }}
GITEA_NUGET_SOURCE_NAME: ${{ vars.S_GITEA_NUGET_SOURCE_NAME }}
jobs:
build-ci-api:
runs-on: [linux,self-hosted]
name: CI Build API
steps:
- name: Checkout
uses: https://github.com/actions/checkout@v4
- name: Setup .NET 9
uses: https://github.com/actions/setup-dotnet@v4
with:
dotnet-version: 9.x
- name: Make Build File Executable
shell: bash
run: |
chmod +x ./build.cmd
chmod +x ./build.sh
- name: Run Nuke Build
shell: bash
run: |
./build.cmd -Target Publish

View File

@ -8,6 +8,7 @@ using Nuke.Common.IO;
using Nuke.Common.ProjectModel; using Nuke.Common.ProjectModel;
using Nuke.Common.Tooling; using Nuke.Common.Tooling;
using Nuke.Common.Tools.DotNet; using Nuke.Common.Tools.DotNet;
using Nuke.Common.Tools.Git;
using Nuke.Common.Tools.GitVersion; using Nuke.Common.Tools.GitVersion;
using Nuke.Common.Utilities.Collections; using Nuke.Common.Utilities.Collections;
using static Nuke.Common.EnvironmentInfo; using static Nuke.Common.EnvironmentInfo;
@ -23,7 +24,6 @@ class Build : NukeBuild
public static int Main() => Execute<Build>(x => x.Pack); public static int Main() => Execute<Build>(x => x.Pack);
private const string NuGetSourceUrl = "https://api.nuget.org/v3/index.json";
private const string LibraryProjectName = "Universley.OrleansContrib.StreamsProvider.Redis"; private const string LibraryProjectName = "Universley.OrleansContrib.StreamsProvider.Redis";
[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")] [Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
@ -43,6 +43,9 @@ class Build : NukeBuild
[Parameter("NuGet API key")] [Parameter("NuGet API key")]
readonly string NuGetApiKey; readonly string NuGetApiKey;
[Parameter("Gitea Nuget package source name")]
readonly string GiteaNugetSourceName = Environment.GetEnvironmentVariable("GITEA_NUGET_SOURCE_NAME");
Target Clean => _ => _ Target Clean => _ => _
.Before(Restore) .Before(Restore)
.Executes(() => .Executes(() =>
@ -106,14 +109,21 @@ class Build : NukeBuild
.Executes(() => .Executes(() =>
{ {
DotNetTasks.DotNetNuGetPush(s => s DotNetTasks.DotNetNuGetPush(s => s
.SetSource(NuGetSourceUrl) .SetSource(GiteaNugetSourceName)
.SetApiKey(NuGetApiKey) .SetApiKey(NuGetApiKey)
.SetTargetPath(NuGetPackagesDirectory / $"{LibraryProjectName}.{GitVersion.NuGetVersionV2}.snupkg")); .SetTargetPath(NuGetPackagesDirectory / $"{LibraryProjectName}.{GitVersion.NuGetVersionV2}.snupkg"));
DotNetTasks.DotNetNuGetPush(s => s DotNetTasks.DotNetNuGetPush(s => s
.SetSource(NuGetSourceUrl) .SetSource(GiteaNugetSourceName)
.SetApiKey(NuGetApiKey)
.SetTargetPath(NuGetPackagesDirectory / $"{LibraryProjectName}.{GitVersion.NuGetVersionV2}.nupkg")); .SetTargetPath(NuGetPackagesDirectory / $"{LibraryProjectName}.{GitVersion.NuGetVersionV2}.nupkg"));
}); });
Target CreateAndPushGitTag => _ => _
.Executes(() =>
{
var gitTag = $"{GitVersion.NuGetVersionV2}";
GitTasks.Git($"tag {gitTag}");
GitTasks.Git($"push origin {gitTag}");
});
}
} }