Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/smoerijf/asyncapi#196-Publish-a…
Browse files Browse the repository at this point in the history
…-global-dotnet-tool' into asyncapi#197-more-logging

# Conflicts:
#	.github/workflows/ci.yaml
#	.gitignore
#	Saunter.sln
#	src/AsyncAPI.Saunter.Generator.Cli/Commands/TofileInternal.cs
#	src/AsyncAPI.Saunter.Generator.Cli/SwashbuckleImport/CommandRunner.cs
#	src/AsyncAPI.Saunter.Generator.Cli/readme.md
#	test/AsyncAPI.Saunter.Generator.Cli.Tests/AsyncAPI.Saunter.Generator.Cli.Tests.csproj
#	test/AsyncAPI.Saunter.Generator.Cli.Tests/IntegrationTests.cs
#	test/AsyncAPI.Saunter.Generator.Cli.Tests/PackAndInstallLocalTests.cs
#	test/Saunter.Tests/Generation/DocumentGeneratorTests/InterfaceAttributeTests.cs
  • Loading branch information
Senn Geerts authored and Senn Geerts committed Jul 11, 2024
2 parents 2c6e2d9 + 72dc742 commit 5823431
Show file tree
Hide file tree
Showing 41 changed files with 1,251 additions and 1,081 deletions.
2 changes: 0 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ dotnet_naming_symbols.all_members.applicable_kinds = *

dotnet_naming_style.pascal_case_style.capitalization = pascal_case

file_header_template = Licensed to the .NET Foundation under one or more agreements.\nThe .NET Foundation licenses this file to you under the MIT license.\nSee the LICENSE file in the project root for more information.

# RS0016: Only enable if API files are present
dotnet_public_api_analyzer.require_api_files = true

Expand Down
12 changes: 12 additions & 0 deletions .github/dotnet/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: dotnet setup
description: "base dotnet setup for project"
runs:
using: composite
steps:
- name: setup
id: setup-dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
6.0.x
8.0.x
14 changes: 14 additions & 0 deletions .github/npm/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: npm setup
description: "base npm setup for project"
runs:
using: composite
steps:
- name: setup dotnet
uses: ./.github/dotnet
- uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Run NPM install
shell: sh
run: npm ci
working-directory: ./src/Saunter.UI
48 changes: 13 additions & 35 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,23 @@
# Note: ci.yaml and release.yaml have some similar steps
# If updating dotnet-version, set in both.

name: Release

on:
push:
tags:
- 'v*.*.*' # e.g. v0.1.0
- "v*.*.*" # e.g. v0.1.0

jobs:
release:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 'lts/*' # latest LTS version
- uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x' # SDK Version to use; x will use the latest version of the channel

- name: Run NPM install
run: npm ci
working-directory: ./src/Saunter.UI
- name: Run dotnet build
run: dotnet build --configuration Debug
- name: Run dotnet test
run: dotnet test --no-build

# Below steps are only on release, not CI.
- name: Set version
# Gets the numeric version from a tag (e.g. v1.2.3 -> 1.2.3)
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Create Nuget package
run: dotnet pack ./src/Saunter/Saunter.csproj --configuration Release -p:Version="$RELEASE_VERSION" --output ./build
- name: Push Nuget package to Nuget.org
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push ./build/*.nupkg --api-key $NUGET_API_KEY --source "https://api.nuget.org/v3/index.json"


- uses: actions/checkout@v2
- name: setup build
uses: ./.github/npm
- name: Set version
# Gets the numeric version from a tag (e.g. v1.2.3 -> 1.2.3)
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Create Nuget package
run: dotnet pack --configuration Release -p:Version="$RELEASE_VERSION" --output ./build
- name: Push Nuget package to Nuget.org
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push ./build/*.nupkg --api-key $NUGET_API_KEY --source "https://api.nuget.org/v3/index.json"
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ Builds and releases managed with github actions.
### Build

* Local builds are as simple as `dotnet build && dotnet test`
* CI builds on every push
* CI builds,fmt,unit on every push
* [.github/workflows/ci.yaml](./.github/workflows/ci.yaml)
* Build and tests MUST pass before merging to master


### Release

* Locally, packages can be created using `dotnet pack ./src/Saunter/Saunter.csproj`
Expand Down
9 changes: 9 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project>
<ItemGroup>
<!-- Make it possible for NSubstitube to make substitues of internal classes -->
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" />

<!-- Make project internals visible to their respective .Tests project -->
<InternalsVisibleTo Include="$(AssemblyName).Tests" />
</ItemGroup>
</Project>
23 changes: 20 additions & 3 deletions Saunter.sln
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,37 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StreetlightsAPI", "examples
{A320E670-5CB0-4815-AF67-D8D09FC92A2A} = {A320E670-5CB0-4815-AF67-D8D09FC92A2A}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E0D34C77-924E-4F6B-9289-5A2F07D125A8}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{E0D34C77-924E-4F6B-9289-5A2F07D125A8}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitattributes = .gitattributes
.gitignore = .gitignore
CHANGELOG.md = CHANGELOG.md
.github\workflows\ci.yaml = .github\workflows\ci.yaml
Directory.Build.props = Directory.Build.props
nuget.config = nuget.config
README.md = README.md
.github\workflows\release.yaml = .github\workflows\release.yaml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Saunter.IntegrationTests.ReverseProxy", "test\Saunter.IntegrationTests.ReverseProxy\Saunter.IntegrationTests.ReverseProxy.csproj", "{7CD09B89-130A-41AF-ADAE-2166C4ED695B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Saunter.Tests.MarkerTypeTests", "test\Saunter.Tests.MarkerTypeTests\Saunter.Tests.MarkerTypeTests.csproj", "{02284473-6DE7-4EE0-8433-2AC295045549}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "actions", "actions", "{D8CB9C0D-9605-457B-979F-C8994B20A926}"
ProjectSection(SolutionItems) = preProject
.github\workflows\ci.yaml = .github\workflows\ci.yaml
.github\workflows\release.yaml = .github\workflows\release.yaml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnet", "dotnet", "{69459F9D-DA73-4E84-8BA7-4CE03E2B7664}"
ProjectSection(SolutionItems) = preProject
.github\dotnet\action.yaml = .github\dotnet\action.yaml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "npm", "npm", "{E8FACA22-CFED-4710-89E4-D55F31BF96B3}"
ProjectSection(SolutionItems) = preProject
.github\npm\action.yaml = .github\npm\action.yaml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AsyncAPI.Saunter.Generator.Cli", "src\AsyncAPI.Saunter.Generator.Cli\AsyncAPI.Saunter.Generator.Cli.csproj", "{6C102D4D-3DA4-4763-B75E-C15E33E7E94A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AsyncAPI.Saunter.Generator.Cli.Tests", "test\AsyncAPI.Saunter.Generator.Cli.Tests\AsyncAPI.Saunter.Generator.Cli.Tests.csproj", "{18AD0249-0436-4A26-9972-B97BA6905A54}"
Expand Down Expand Up @@ -173,6 +188,8 @@ Global
{F188D4A7-BBCB-464F-A370-2BD84D18EA79} = {6ABD4842-47AF-49A5-B057-0EBA64416789}
{7CD09B89-130A-41AF-ADAE-2166C4ED695B} = {6491E321-2D02-44AB-9116-D722FE169595}
{02284473-6DE7-4EE0-8433-2AC295045549} = {6491E321-2D02-44AB-9116-D722FE169595}
{69459F9D-DA73-4E84-8BA7-4CE03E2B7664} = {D8CB9C0D-9605-457B-979F-C8994B20A926}
{E8FACA22-CFED-4710-89E4-D55F31BF96B3} = {D8CB9C0D-9605-457B-979F-C8994B20A926}
{6C102D4D-3DA4-4763-B75E-C15E33E7E94A} = {28D4C365-FDED-49AE-A97D-36202E24A55A}
{18AD0249-0436-4A26-9972-B97BA6905A54} = {6491E321-2D02-44AB-9116-D722FE169595}
{A320E670-5CB0-4815-AF67-D8D09FC92A2A} = {28D4C365-FDED-49AE-A97D-36202E24A55A}
Expand Down
14 changes: 0 additions & 14 deletions src/AsyncAPI.Saunter.Generator.Cli/Args.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>12</LangVersion>
<RootNamespace>AsyncAPI.Saunter.Generator.Cli</RootNamespace>

<Description>AsyncAPI Command Line Tools</Description>
<Description>AsyncAPI Command Line Tools: Dotnet tool to generate AsyncAPI spec file from dotnet startup assembly.</Description>
<Authors>AsyncAPI Initiative</Authors>
<PackAsTool>true</PackAsTool>
<PackageId>AsyncAPI.Saunter.Generator.Cli</PackageId>
<PackageType>DotnetTool</PackageType>
<ToolCommandName>dotnet-asyncapi</ToolCommandName>
<PackageTags>asyncapi;aspnetcore;openapi;documentation;amqp;generator;cli;tool</PackageTags>
<PackageReadmeFile>readme.md</PackageReadmeFile>
Expand All @@ -23,7 +24,10 @@
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<Version>1.0.1</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
Expand All @@ -38,18 +42,21 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AsyncAPI.NET.Readers" Version="5.2.1" />

<!-- Development Dependencies -->
<PackageReference Include="AsyncAPI.NET.Readers" Version="5.2.1" PrivateAssets="All" />
<PackageReference Include="ConsoleAppFramework" Version="5.2.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="NSwag.Commands" Version="14.0.8" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Saunter\Saunter.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="readme.md" Pack="true" PackagePath="\"/>
<None Include="readme.md" Pack="true" PackagePath="\" />
<None Include="../../assets/logo.png" Pack="true" PackagePath="/" />
</ItemGroup>

Expand Down
46 changes: 0 additions & 46 deletions src/AsyncAPI.Saunter.Generator.Cli/Commands/Tofile.cs

This file was deleted.

Loading

0 comments on commit 5823431

Please sign in to comment.