-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(package): updated package settings
- Loading branch information
1 parent
f02c202
commit 058fe0f
Showing
21 changed files
with
542 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
env: | ||
WORKING_DIRECTORY: AElf.ExceptionHandler/ | ||
environment: prod | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # Ensure the full history is fetched so we can check the commit history | ||
|
||
- name: Verify tag is on master branch | ||
id: verify_tag | ||
run: | | ||
# Get the commit SHA of the tag | ||
TAG_COMMIT=$(git rev-list -n 1 $GITHUB_REF) | ||
# Check if the commit exists on the master branch | ||
if git merge-base --is-ancestor $TAG_COMMIT origin/master; then | ||
echo "Tag commit is on master branch." | ||
echo "IS_ON_MASTER=true" >> $GITHUB_ENV | ||
else | ||
echo "Tag commit is not on master branch." | ||
echo "IS_ON_MASTER=false" >> $GITHUB_ENV | ||
fi | ||
- name: Stop if not on master | ||
if: env.IS_ON_MASTER != 'true' | ||
run: | | ||
echo "This tag was not created from the master branch. Exiting." | ||
exit 1 | ||
- name: Setup .NET | ||
if: env.IS_ON_MASTER == 'true' | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '8.0.*' # Change this to the .NET version you're using | ||
|
||
- name: Extract version from tag | ||
if: env.IS_ON_MASTER == 'true' | ||
run: | | ||
TAG_NAME=$(echo $GITHUB_REF | sed 's/refs\/tags\///') | ||
VERSION=${TAG_NAME#v} | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
- name: Pack | ||
if: env.IS_ON_MASTER == 'true' | ||
working-directory: ${{ env.WORKING_DIRECTORY }} | ||
run: dotnet pack --configuration Release --output nupkgs /p:Version=$VERSION | ||
|
||
- name: Publish NuGet packages | ||
if: env.IS_ON_MASTER == 'true' | ||
working-directory: ${{ env.WORKING_DIRECTORY }} | ||
run: | | ||
dotnet nuget push "nupkgs/*.nupkg" --api-key ${{ secrets.TEMPLATES_NUGET_API_KEY }} --source ${{ vars.TEMPLATES_NUGET_SOURCE_URL }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<PackageType>Contract</PackageType> | ||
<PackageId>AElf.ExceptionHandler</PackageId> | ||
<Title>AElf ExceptionHandler</Title> | ||
<Authors>AElf</Authors> | ||
<Description>An ExceptionHandler module for use in ABP and Orleans framework.</Description> | ||
<PackageTags>abp;module;grains;orleans</PackageTags> | ||
<TargetFrameworks>net8.0;net7.0</TargetFrameworks> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<RepositoryUrl>https://github.com/AElfProject/AOPExceptionModule</RepositoryUrl> | ||
<RepositoryType>git</RepositoryType> | ||
<PackageProjectUrl>https://github.com/AElfProject/AOPExceptionModule</PackageProjectUrl> | ||
<RootNamespace>AElf.ExceptionHandler</RootNamespace> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Orleans.Core.Abstractions" Version="7.2.6" /> | ||
<PackageReference Include="Volo.Abp.Core" Version="8.0.5" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup> | ||
<PackageReadmeFile>README.md</PackageReadmeFile> | ||
<PackageLicenseFile>LICENSE</PackageLicenseFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Include="../README.md" Pack="true" PackagePath="" /> | ||
<None Include="../LICENSE" Pack="true" PackagePath="" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System.Collections.Concurrent; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Volo.Abp; | ||
using Volo.Abp.Modularity; | ||
|
||
namespace AElf.ExceptionHandler; | ||
|
||
public class AOPExceptionModule : AbpModule | ||
{ | ||
public override void ConfigureServices(ServiceConfigurationContext context) | ||
{ | ||
context.Services.AddTransient<ExceptionHandlerInterceptor>() | ||
.AddTransient<IInterceptor, ExceptionHandler>() | ||
.AddSingleton<ConcurrentDictionary<string, ExceptionHandlerInfo>>() | ||
.AddSingleton<ConcurrentDictionary<string, Func<object, object[], Task>>>(); | ||
|
||
context.Services.OnRegistered(options => | ||
{ | ||
var methodInfos = options.ImplementationType.GetMethods(); | ||
// Check if any of the class methods is decorated with the ExceptionHandlerAttribute | ||
foreach (var methodInfo in methodInfos) | ||
{ | ||
if (methodInfo.IsDefined(typeof(ExceptionHandlerAttribute), true)) | ||
{ | ||
var result = options.Interceptors.TryAdd<ExceptionHandlerInterceptor>(); | ||
if (!result) | ||
{ | ||
throw new AbpException("ExceptionHandlingInterceptor is already registered."); | ||
} | ||
} | ||
} | ||
}); | ||
} | ||
} |
Oops, something went wrong.