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

Github action auto release #2

Merged
merged 5 commits into from
Aug 23, 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
59 changes: 31 additions & 28 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
NuGetDirectory: ${{ github.workspace }}/nuget
TestsPath: src/tests/Ninja.Sharp.OpenMessagingWrapper.Tests/Ninja.Sharp.OpenMessagingWrapper.Tests.csproj
ProjectPath: src/Ninja.Sharp.OpenMessagingWrapper/Ninja.Sharp.OpenMessagingWrapper.csproj

defaults:
run:
Expand All @@ -35,7 +37,7 @@ jobs:
uses: actions/setup-dotnet@v4

# Create the NuGet package in the folder from the environment variable NuGetDirectory
- run: dotnet pack src/Ninja.Sharp.OpenMessagingWrapper/Ninja.Sharp.OpenMessagingWrapper.csproj --configuration Release --output ${{ env.NuGetDirectory }}
- run: dotnet pack ${{ env.ProjectPath }} --configuration Release --output ${{ env.NuGetDirectory }}

# Publish the NuGet package as an artifact, so they can be used in the following jobs
- uses: actions/upload-artifact@v3
Expand All @@ -45,38 +47,39 @@ jobs:
retention-days: 7
path: ${{ env.NuGetDirectory }}/*.nupkg

# validate_nuget:
# runs-on: ubuntu-latest
# needs: [ create_nuget ]
# steps:
# # Install the .NET SDK indicated in the global.json file
# - name: Setup .NET
# uses: actions/setup-dotnet@v4

# # Download the NuGet package created in the previous job
# - uses: actions/download-artifact@v3
# with:
# name: nuget
# path: ${{ env.NuGetDirectory }}

# - name: Install nuget validator
# run: dotnet tool update Meziantou.Framework.NuGetPackageValidation.Tool --global

# # Validate metadata and content of the NuGet package
# # https://www.nuget.org/packages/Meziantou.Framework.NuGetPackageValidation.Tool#readme-body-tab
# # If some rules are not applicable, you can disable them
# # using the --excluded-rules or --excluded-rule-ids option
# - name: Validate package
# run: meziantou.validate-nuget-package (Get-ChildItem "${{ env.NuGetDirectory }}/*.nupkg")

run_test:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v4
- name: Run tests
run: dotnet test src/tests/Ninja.Sharp.OpenMessagingWrapper.Tests/Ninja.Sharp.OpenMessagingWrapper.Tests.csproj --configuration Release
run: dotnet test ${{ env.TestsPath }} --configuration Release

create_release:
# https://github.com/actions/create-release
# if: github.event_name == 'release'
name: Create Release
runs-on: ubuntu-latest
needs: [
deploy,
run_test,
create_nuget
]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

deploy:
# Publish only when creating a GitHub Release
Expand All @@ -85,8 +88,8 @@ jobs:
# if: github.event_name == 'release'
runs-on: ubuntu-latest
needs: [
#validate_nuget,
run_test
run_test,
create_nuget
]
steps:
# Download the NuGet package created in the previous job
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ Packages

| Package | NuGet Stable |
| ------- | ------------ |
| [OpenMessagingWrapperWrapper](https://github.com/thesharpninjas/Ninja.Sharp.OpenMessagingWrapperWrapper/) | [![OpenMessagingWrapperWrapper](https://img.shields.io/badge/nuget-v0.0.1-blue)](https://www.nuget.org/packages/Ninja.Sharp.OpenMessagingWrapperWrapper)
| [OpenMessagingWrapper](https://github.com/thesharpninjas/Ninja.Sharp.OpenMessagingWrapper/) | [![OpenMessagingWrapper](https://img.shields.io/badge/nuget-v0.0.1-blue)](https://www.nuget.org/packages/Ninja.Sharp.OpenMessagingWrapper)

Features
--------
OpenMessagingWrapperWrapper is a [NuGet .NET library](https://www.nuget.org/packages/Ninja.Sharp.OpenMessagingWrapperWrapper) that aims in simplifying usage for the most common messaging framework.
OpenMessagingWrapperWrapper is a [NuGet .NET library](https://www.nuget.org/packages/Ninja.Sharp.OpenMessagingWrapper) that aims in simplifying usage for the most common messaging framework.
The library encapsulates some behavior and common options for most frameworks, providing a simple management to rule them all via configuration.

Right now, it allows integration with these framework:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<!--<GeneratePackageOnBuild>True</GeneratePackageOnBuild>-->
<Title>A .net driver for simplified access to common messaging system.</Title>
<Version>0.0.1-alpha</Version>
<Version>0.0.2-alpha</Version>
<Company>The Sharp Ninjas</Company>
<Authors>The Sharp Ninjas</Authors>
<Product>OpenMessagingWrapper</Product>
Expand All @@ -29,13 +29,13 @@
<PackageReference Include="ArtemisNetClient.Extensions.DependencyInjection" Version="2.16.0" />
<PackageReference Include="ArtemisNetClient.Extensions.Hosting" Version="2.16.0" />
<PackageReference Include="Apache.NMS.ActiveMQ" Version="2.1.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="6.0.1" />
<PackageReference Include="microsoft.extensions.diagnostics.healthchecks" Version="8.0.6" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" Version="8.0.6" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="microsoft.extensions.diagnostics.healthchecks" Version="8.0.8" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" Version="8.0.8" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.1.1">
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.2.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
Expand Down
Loading