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

Update to NET 9.0 #280

Closed
wants to merge 26 commits into from
Closed
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
12 changes: 6 additions & 6 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
location: ${{ env.DOCS_FOLDER }}

- name: Upload documentation
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: docs
path: |
Expand All @@ -42,7 +42,7 @@ jobs:

steps:
- name: Download artifacts
uses: actions/download-artifact@v1
uses: actions/download-artifact@v4
with:
name: docs
path: artifacts
Expand All @@ -60,21 +60,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: docs

- name: Unzip artifact
run: unzip -O UTF-8 -qq ${{ env.ARTIFACT }} -d dir

- name: Setup Pages
uses: actions/configure-pages@v2
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
path: dir

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4
5 changes: 3 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ env:
CAKE_SETTINGS_SKIPVERIFICATION: true

on:
workflow_dispatch:
push:
tags:
- "*"
Expand All @@ -24,7 +25,7 @@ jobs:

- uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
dotnet-version: '9.0.x'

- name: Build, Test and Pack
run: |
Expand All @@ -33,4 +34,4 @@ jobs:

- name: Push to nuget
working-directory: artifacts/
run: dotnet nuget push *.nupkg -s $NUGET_SERVER -k $NUGET_API_KEY
run: dotnet nuget push *.nupkg -s $NUGET_SERVER -k $NUGET_API_KEY
2 changes: 1 addition & 1 deletion .github/workflows/pull-requests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

- uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
dotnet-version: '9.0.x'

- name: Build and Test
run: |
Expand Down
22 changes: 11 additions & 11 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<Project>
<ItemGroup>
<PackageVersion Include="Ardalis.SmartEnum" Version="8.0.0" />
<PackageVersion Include="Ardalis.SmartEnum.SystemTextJson" Version="8.0.0" />
<PackageVersion Include="Aspire.Hosting" Version="8.0.0-preview.5.24201.12" />
<PackageVersion Include="Aspire.Hosting.Testing" Version="8.0.0-preview.5.24201.12" />
<PackageVersion Include="Ardalis.SmartEnum" Version="8.1.0" />
<PackageVersion Include="Ardalis.SmartEnum.SystemTextJson" Version="8.1.0" />
<PackageVersion Include="Aspire.Hosting" Version="9.0.0" />
<PackageVersion Include="Aspire.Hosting.Testing" Version="9.0.0" />
<PackageVersion Include="CliWrap" Version="3.6.6" />
<PackageVersion Include="DockerComposeBuilder" Version="0.2.4" />
<PackageVersion Include="DockerComposeBuilder" Version="0.4.3" />
<PackageVersion Include="Handlebars.Net" Version="2.1.6" />
<PackageVersion Include="JsonPath.Net" Version="1.0.1.2" />
<PackageVersion Include="KubernetesClient" Version="13.0.37" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="JsonPath.Net" Version="2.1.0" />
<PackageVersion Include="KubernetesClient" Version="16.0.2" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.1" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.1" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="NuGet.Protocol" Version="6.9.1" />
<PackageVersion Include="Spectre.Console" Version="0.48.0" />
<PackageVersion Include="NuGet.Protocol" Version="6.12.1" />
<PackageVersion Include="Spectre.Console" Version="0.49.1" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageVersion Include="System.CommandLine.NamingConventionBinder" Version="2.0.0-beta4.22272.1" />
<PackageVersion Include="YamlDotNet" Version="15.1.2" />
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
![nuget-icon](https://github.com/prom3theu5/aspirational-manifests/assets/1518610/5f4402e9-6f2c-4ca4-b457-206fb8233155)
# Aspirate (Aspir8)

## note: this project is forked from prom3theu5 and if maintainer continues to maintain the project, this fork will be deleted.

### Handle deployment yaml generation for a .NET Aspire AppHost

<https://github.com/prom3theu5/aspirational-manifests/assets/1518610/319c4e1e-d47f-40e3-a8c3-ddf124b003a2>
<https://github.com/vdboots/aspirational-manifests/assets/1518610/319c4e1e-d47f-40e3-a8c3-ddf124b003a2>

Documentation: https://prom3theu5.github.io/aspirational-manifests/
Documentation: https://vdboots.github.io/aspirational-manifests/

# Table of Contents
1. [Installation as a global tool](#to-install-as-a-global-tool)
Expand All @@ -28,7 +30,7 @@ Documentation: https://prom3theu5.github.io/aspirational-manifests/
## To Install as a global tool

```bash
dotnet tool install -g aspirate
dotnet tool install -g aspirate.vnext --prerelease
```

> NOTE: Add the `--prelease` option, to install the latest preview version.
Expand Down Expand Up @@ -140,7 +142,7 @@ When using this flag, all configuration arguments must be passed on the command
Aspirate can be uninstalled as a global tool by running:

```bash
dotnet tool uninstall -g aspirate
dotnet tool uninstall -g aspirate.vnext
```

## Configuring the Windows Terminal For Unicode and Emoji Support
Expand Down Expand Up @@ -174,8 +176,8 @@ Aspirate can be used in a devcontainer by installing the feature:

```json
features": {
"ghcr.io/prom3theu5/aspirational-manifests/aspirate:latest": {}
"ghcr.io/vdboots/aspirational-manifests/aspirate:latest": {}
}
```

An Example of a devcontainer can be found on the documentation page: [Here](https://prom3theu5.github.io/aspirational-manifests/installation-as-a-devcontainer-feature.html#example-dev-container-configuration)
An Example of a devcontainer can be found on the documentation page: [Here](https://vdboots.github.io/aspirational-manifests/installation-as-a-devcontainer-feature.html#example-dev-container-configuration)
2 changes: 1 addition & 1 deletion docs/Writerside/topics/Getting-Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

Generate deployment yaml for a .NET Aspire AppHost project.

<video src="https://github.com/prom3theu5/aspirational-manifests/assets/1518610/319c4e1e-d47f-40e3-a8c3-ddf124b003a2" />
<video src="https://github.com/vdboots/aspirational-manifests/assets/1518610/319c4e1e-d47f-40e3-a8c3-ddf124b003a2" />
4 changes: 2 additions & 2 deletions docs/Writerside/topics/Installing-as-a-Global-Tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
%product% is shipped to nuget as a .NET Core Global Tool, which means you can install it with a single command:

```bash
dotnet tool install -g aspirate --prerelease
dotnet tool install -g aspirate.vnext --prerelease
```

Alternatively, if you already have %product% installed, you can update it to the latest version using the following command:

```bash
dotnet tool update -g aspirate --prerelease
dotnet tool update -g aspirate.vnext --prerelease
```
6 changes: 3 additions & 3 deletions ext/devcontainer/src/aspirate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ Installs [Aspir8](https://github.com/prom3theu5/aspirational-manifests)
```json
"features": {
"ghcr.io/devcontainers/features/dotnet:2": {}
"ghcr.io/prom3theu5/aspirational-manifests/aspirate:latest": {}
"ghcr.io/vdboots/aspirational-manifests/aspirate:latest": {}
}
```

## Example Usage - Install current latest `aspirate` version **with dotnet base image**

```json
"features": {
"ghcr.io/prom3theu5/aspirational-manifests/aspirate:latest": {}
"ghcr.io/vdboots/aspirational-manifests/aspirate:latest": {}
}
```
```
6 changes: 3 additions & 3 deletions ext/devcontainer/src/aspirate/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "aspirate",
"version": "0.1.0",
"id": "aspirate.vnext",
"version": "9.0.1-preview",
"name": "Aspir8 Aspirate to Kubernetes",
"documentationURL": "https://prom3theu5.github.io/aspirational-manifests/",
"documentationURL": "https://vdboots.github.io/aspirational-manifests/",
"description": "Installs Aspir8.",
"installsAfter": [
"ghcr.io/devcontainers/features/dotnet"
Expand Down
2 changes: 1 addition & 1 deletion ext/devcontainer/src/aspirate/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

echo "(*) Installing Aspir8"

dotnet tool update aspirate --prerelease --tool-path /usr/local/bin
dotnet tool update aspirate.vnext --prerelease --tool-path /usr/local/bin
15 changes: 9 additions & 6 deletions src/Aspirate.Cli/Aspirate.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<AssemblyName>aspirate</AssemblyName>
<PackAsTool>true</PackAsTool>
<ToolName>aspirate</ToolName>
<Version>0.1.0-preview</Version>
<Version>9.0.0-preview</Version>
<PackageId>aspirate.vnext</PackageId>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<PropertyGroup>
<Title>Aspirate</Title>
<Authors>David Sekula / Prom3theu5</Authors>
<Description>Automatic kustomize manifest generation for applications powered by the Microsoft .Net Aspire Cloud framework.</Description>
<PackageProjectUrl>https://github.com/prom3theu5/aspirational-manifests</PackageProjectUrl>
<Authors>Vincent Boots</Authors>
<Description>Automatic kustomize manifest generation for applications powered by the Microsoft .Net Aspire Cloud framework.
fork from: https://github.com/prom3theu5/aspirational-manifests</Description>
<PackageProjectUrl>https://github.com/vdboots/aspirational-manifests</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/prom3theu5/aspirational-manifests.git</RepositoryUrl>
<RepositoryUrl>https://github.com/vdboots/aspirational-manifests.git</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageTags>aspire;kubernetes;aspirate;kustomize;manifests</PackageTags>
<PackageReleaseNotes>Initial Release</PackageReleaseNotes>
Expand Down
2 changes: 1 addition & 1 deletion src/Aspirate.Commands/Aspirate.Commands.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/Aspirate.Processors/Aspirate.Processors.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ public void ResolveJsonExpressions(JsonNode? jsonNode, JsonNode rootNode)
}
} while (_unresolvedExpressionPointers.Count > 0);
}

[GeneratedRegex(@"\{([\w\.-]+)\}")]
private static partial Regex PlaceholderPatternRegex();

public static IJsonExpressionProcessor CreateDefaultExpressionProcessor() =>
new JsonExpressionProcessor(BindingProcessor.CreateDefaultExpressionProcessor());

Expand All @@ -55,6 +51,7 @@ private void ResolveJsonExpressionsRecursive(JsonNode? jsonNode, JsonNode rootNo
}
}


private void HandleJsonObject(JsonNode rootNode, JsonObject jsonObject)
{
var keys = new List<string>(((IDictionary<string, JsonNode?>)jsonObject).Keys);
Expand Down Expand Up @@ -84,6 +81,7 @@ private void HandleJsonArray(JsonNode rootNode, JsonArray jsonArray)

private void HandleJsonValue(JsonNode rootNode, JsonNode jsonValue) => ReplaceWithResolvedExpression(rootNode, jsonValue);

private static readonly Regex PlaceholderPatternRegex = new(@"{([\w.-]+)}", RegexOptions.Compiled);
private void ReplaceWithResolvedExpression(JsonNode rootNode, JsonNode jsonValue)
{
var input = jsonValue.ToString();
Expand All @@ -99,7 +97,7 @@ private void ReplaceWithResolvedExpression(JsonNode rootNode, JsonNode jsonValue
return;
}

var matches = PlaceholderPatternRegex().Matches(input);
var matches = PlaceholderPatternRegex.Matches(input);
for (var i = 0; i < matches.Count; i++)
{
var match = matches[i];
Expand Down
2 changes: 1 addition & 1 deletion src/Aspirate.Secrets/Aspirate.Secrets.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/Aspirate.Services/Aspirate.Services.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

namespace Aspirate.Services.Implementations;

public sealed class ContainerCompositionService(
Expand Down
7 changes: 3 additions & 4 deletions src/Aspirate.Services/Implementations/KubeCtlService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ namespace Aspirate.Services.Implementations;

public partial class KubeCtlService(IFileSystem filesystem, IAnsiConsole console, IShellExecutionService shellExecutionService) : IKubeCtlService
{
[GeneratedRegex("name: (.*)")]
private static partial Regex NamespaceMatcher();

private static readonly Regex NamespaceMatcher = new("name: (.*)", RegexOptions.Compiled);
public async Task<string?> SelectKubernetesContextForDeployment()
{
var contexts = await GatherContexts();
Expand Down Expand Up @@ -176,12 +175,12 @@ private async Task<string> ParseNamespace(string fullOutputPath)
}

var namespaceContent = await filesystem.File.ReadAllTextAsync(namespaceFile);

var namespaceMatch = NamespaceMatcher().Match(namespaceContent);
var namespaceMatch = NamespaceMatcher.Match(namespaceContent);

return namespaceMatch.Success ? namespaceMatch.Groups[1].Value : KubeCtlLiterals.KubeCtlDefaultNamespace;
}


private static List<string?> ParseResponseAsContextList(string jsonString)
{
try
Expand Down
10 changes: 7 additions & 3 deletions src/Aspirate.Services/Implementations/VersionCheckService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private async Task PerformUpdateCheck(string lastVersionCheckedFilePath)
var resource = await repository.GetResourceAsync<PackageMetadataResource>();

var metadata = await resource.GetMetadataAsync(
"aspirate",
"aspirate.vnext",
includePrerelease: true,
includeUnlisted: false,
new SourceCacheContext(),
Expand All @@ -144,12 +144,16 @@ private async Task PerformUpdateCheck(string lastVersionCheckedFilePath)
logger.MarkupLine($"[bold][yellow]A new version of Aspirate is available: [blue]{latestVersion}[/].[/][/]");
logger.MarkupLine($"[bold][yellow]You are currently using: [blue]{currentVersion}[/].[/][/]");
logger.MarkupLine(
$"[italic][yellow]You can update with: [blue]dotnet tool install -g aspirate --prerelease[/].[/][/]");
$"[italic][yellow]You can update with: [blue]dotnet tool install -g aspirate.vnext --prerelease[/].[/][/]");
}
}
catch (HttpRequestException)
{
logger.MarkupLine($"[red]Network error: Unable to reach api.nuget.org. Please check your internet connection. Continuing without connection [/]");
}
catch (Exception e)
{
logger.ValidationFailed(e.Message);
logger.ValidationFailed(e.Message);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Aspirate.Shared/Aspirate.Shared.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
2 changes: 2 additions & 0 deletions src/Aspirate.Shared/Extensions/ComposeExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using DockerComposeBuilder.Converters;

namespace Aspirate.Shared.Extensions;

public static class ComposeExtensions
Expand Down
Loading