Skip to content

Commit

Permalink
fix: bug in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobritodev committed Mar 17, 2022
1 parent 58aa518 commit c8d8084
Show file tree
Hide file tree
Showing 18 changed files with 415 additions and 277 deletions.
37 changes: 37 additions & 0 deletions .github/hooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/sh
#
# An example hook script to check the commit log message.
# Called by "git commit" with one argument, the name of the file
# that has the commit message. The hook should exit with non-zero
# status after issuing an appropriate message if it wants to stop the
# commit. The hook is allowed to edit the commit message file.
#
# To enable this hook, rename this file to "commit-msg".

# Uncomment the below to add a Signed-off-by line to the message.
# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
# hook is more suited to it.
#
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"

# This example catches duplicate Signed-off-by lines.

test "" = "$(grep '^Signed-off-by: ' "$1" |
sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
echo >&2 Duplicate Signed-off-by lines.
exit 1
}
if ! head -1 "$1" | grep -qE "^(feat|fix|ci|chore|docs|test|style|refactor|chk)(\(.+?\))?: .{1,}$"; then
echo "Aborting commit. Your commit message is invalid. See some examples below:" >&2
echo "feat(logging): added logs for failed signups" >&2
echo "fix(homepage): fixed image gallery" >&2
echo "test(homepage): updated tests" >&2
echo "docs(readme): added new logging table information" >&2
echo "For more information check https://www.conventionalcommits.org/en/v1.0.0/ for more details" >&2
exit 1
fi
if ! head -1 "$1" | grep -qE "^.{1,50}$"; then
echo "Aborting commit. Your commit message is too long." >&2
exit 1
fi
46 changes: 0 additions & 46 deletions .github/workflows/publish-package.yml

This file was deleted.

64 changes: 64 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: NetDevPack - MASTER Publish

on:
push:
branches: [ master ]

env:
REPOSITORY_URL: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
CURRENT_REPO_URL: https://github.com/${{ github.repository }}

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup .NET 6
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x

- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x

- name: Setup .NET Core 2.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Test
run: dotnet test

- name: Semantic Release
id: semantic
uses: cycjimmy/semantic-release-action@v2
with:
semantic_version: 18.0.1
extra_plugins: |
@semantic-release/changelog
@semantic-release/github
@semantic-release/git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Generate Package
run: dotnet pack -c Release -o out -p:PackageVersion=${{ steps.semantic.outputs.new_release_version }} -p:RepositoryUrl=${{env.CURRENT_REPO_URL}}

- name: Publish the package to nuget.org
run: dotnet nuget push ./out/*.nupkg --skip-duplicate --no-symbols true -k ${{ secrets.NUGET_AUTH_TOKEN}} -s https://api.nuget.org/v3/index.json
15 changes: 8 additions & 7 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
name: Pull Request Analisys
name: NetDevPack - MASTER PR

on:
pull_request:
branches: [ master ]

jobs:
build:
runs-on: windows-latest
defaults:
run:
working-directory: ./src
pull-request:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
Expand All @@ -19,7 +16,6 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
include-prerelease: true

- name: Setup .NET 5
uses: actions/setup-dotnet@v1
Expand All @@ -31,6 +27,11 @@ jobs:
with:
dotnet-version: 3.1.x

- name: Setup .NET Core 2.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.x

- name: Restore dependencies
run: dotnet restore

Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,43 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Authors>Eduardo Pires</Authors>
<LangVersion>10.0</LangVersion>
<PackageIconUrl>https://raw.githubusercontent.com/NetDevPack/NetDevPack/master/assets/IconNuget.png</PackageIconUrl>
<PackageTags>jwt jwks rsa ecdsa hmac oauth2 key rotating</PackageTags>
<Title>JWT Signing Credentials - Expose JWKS public endpoint</Title>
<Description>Component to manage your JWKS. Auto generate and manage your JWK</Description>
<NeutralLanguage>en</NeutralLanguage>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/NetDevPack/NetDevPack.Security.JwtSigningCredentials</RepositoryUrl>
<RepositoryType>git</RepositoryType>

</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="2.2.2" />
</ItemGroup>


<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="3.1.18" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.23" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.15" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\NetDevPack.Security.Jwt.Core\NetDevPack.Security.Jwt.Core.csproj" />
</ItemGroup>

</Project>

0 comments on commit c8d8084

Please sign in to comment.