Skip to content
This repository was archived by the owner on Aug 30, 2025. It is now read-only.
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
439 changes: 439 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 2
updates:

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "daily"
assignees:
- "NelsonBN"
reviewers:
- "NelsonBN"
commit-message:
prefix: "GitHubActions"
include: "scope"
target-branch: "develop"

# Nuget packages
- package-ecosystem: "nuget"
directory: "/" # Location of package manifests
schedule:
interval: "daily"
assignees:
- "NelsonBN"
reviewers:
- "NelsonBN"
commit-message:
prefix: "NuGet"
include: "scope"
target-branch: "develop"
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
name: CI/CD
name: 'Publish Nuget'

on:
push:
branches:
- main


jobs:
build-and-deploy:

deploy-nuget:
name: "Deploy NuGet"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@main

- name: Set up .NET Core
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
dotnet-version: '6.0.200'

- name: Build with dotnet
run: dotnet build --configuration Release
- name: Restore dependencies
run: dotnet restore

- name: Test
run: dotnet test
- name: Build
run: dotnet build --configuration Release

- name: Create the Package
run: dotnet pack --configuration Release

- name: Publish
run: dotnet nuget push "./src/bin/PowerUtils.Net.Primitives.*.nupkg" -k ${{ secrets.NUGET_TOKEN }} -s https://api.nuget.org/v3/index.json
run: dotnet nuget push "./src/bin/PowerUtils.Net.Primitives.*.nupkg" -k ${{ secrets.NUGET_TOKEN }} -s https://api.nuget.org/v3/index.json
66 changes: 66 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: 'SonarCloud'

on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]
branches:
- main


jobs:

sonar-scanner:
name: "Sonar scanner"
runs-on: windows-latest
steps:

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.200'

- name: Set up JDK 11
uses: actions/setup-java@v3.0.0
with:
distribution: 'adopt'
java-version: '11'

- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Cache SonarCloud packages
uses: actions/cache@v2.1.7
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache SonarCloud scanner
id: cache-sonar-scanner
uses: actions/cache@v2.1.7
with:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner

- name: Install SonarCloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: pwsh
run: |
New-Item -Path .\.sonar\scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner

- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: pwsh
run: |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"${{ secrets.SONAR_PROJECT_KEY }}" /o:"${{ secrets.SONAR_ORGANIZATION }}" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
dotnet build --configuration Release
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
34 changes: 34 additions & 0 deletions .github/workflows/test-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'Tests'

on:
push:
branches:
- develop
pull_request:
types: [opened, reopened, synchronize]
branches:
- main


jobs:

test-project:
name: "Testing project"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.200'

- name: Restore dependencies
run: dotnet restore

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

- name: Test
run: dotnet test --no-build
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,13 @@ $RECYCLE.BIN/
##
## Visual Studio Code
##
.vscode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

## Sonar
.sonarqube
sonarscan.bat
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Changelog




## [1.1.0] - 2022-02-25
[Full Changelog](https://github.com/TechNobre/PowerUtils.Net.Primitives/compare/v1.0.0...v1.1.0)


### New Features

- Added constant for Status Code UNPROCESSABLE ENTITY 422;


### Enhancements

- Updated documentation;




## [1.0.0] - 2021-11-21

- Start project
23 changes: 20 additions & 3 deletions PowerUtils.Net.Primitives.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,31 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Project", "Project", "{BECA00C2-6FEE-416B-BF8A-DFBFC067ED21}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "1.project", "1.project", "{BECA00C2-6FEE-416B-BF8A-DFBFC067ED21}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
CHANGELOG.md = CHANGELOG.md
global.json = global.json
LICENSE = LICENSE
.github\workflows\main.yml = .github\workflows\main.yml
README.md = README.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "1.PowerUtils.Net.Primitives", "src\1.PowerUtils.Net.Primitives.csproj", "{A3649905-3DE7-4BBA-BC5D-1D62089C7FFD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "2.PowerUtils.Net.Primitives.Tests", "test\2.PowerUtils.Net.Primitives.Tests.csproj", "{EACB7A09-1067-4312-B8D1-1D29897BA8D4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "2.PowerUtils.Net.Primitives.Tests", "tests\PowerUtils.Net.Primitives.Tests\2.PowerUtils.Net.Primitives.Tests.csproj", "{EACB7A09-1067-4312-B8D1-1D29897BA8D4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2.cicd", "2.cicd", "{2ED72909-1EFA-41DE-9E9A-BD15DB2A396B}"
ProjectSection(SolutionItems) = preProject
dependabot.yml = dependabot.yml
publish-nuget.yml = publish-nuget.yml
sonarcloud.yml = sonarcloud.yml
test-project.yml = test-project.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3.src", "3.src", "{6F5B2D55-69F7-43F7-8BA8-97BB4D79276D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "4.tests", "4.tests", "{3B90E664-51A0-4997-B2F3-58E2931E3B03}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -34,6 +47,10 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{A3649905-3DE7-4BBA-BC5D-1D62089C7FFD} = {6F5B2D55-69F7-43F7-8BA8-97BB4D79276D}
{EACB7A09-1067-4312-B8D1-1D29897BA8D4} = {3B90E664-51A0-4997-B2F3-58E2931E3B03}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A48BE987-BAA5-4255-862F-32B60FD428A9}
EndGlobalSection
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# PowerUtils.Net.Primitives
Provides additional types and constants for network-based libraries.

![CI](https://github.com/TechNobre/PowerUtils.Net.Primitives/actions/workflows/main.yml/badge.svg)
![Tests](https://github.com/TechNobre/PowerUtils.Net.Primitives/actions/workflows/test-project.yml/badge.svg)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=TechNobre_PowerUtils.Net.Primitives&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=TechNobre_PowerUtils.Net.Primitives)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=TechNobre_PowerUtils.Net.Primitives&metric=coverage)](https://sonarcloud.io/summary/new_code?id=TechNobre_PowerUtils.Net.Primitives)

[![NuGet](https://img.shields.io/nuget/v/PowerUtils.Net.Primitives.svg)](https://www.nuget.org/packages/PowerUtils.Net.Primitives)
[![Nuget](https://img.shields.io/nuget/dt/PowerUtils.Net.Primitives.svg)](https://www.nuget.org/packages/PowerUtils.Net.Primitives)
[![License: MIT](https://img.shields.io/github/license/ofpinewood/http-exceptions.svg)](https://github.com/TechNobre/PowerUtils.Net.Primitives/blob/main/LICENSE)
Expand Down Expand Up @@ -69,6 +72,7 @@ dotnet add package PowerUtils.Net.Primitives
- `StatusCodeLink.UNSUPPORTED_MEDIA_TYPE`;
- `StatusCodeLink.REQUESTED_RANGE_NOT_SATISFIABLE`;
- `StatusCodeLink.EXPECTATION_FAILED`;
- `StatusCodeLink.UNPROCESSABLE_ENTITY`;
- `StatusCodeLink.UPGRADE_REQUIRED`;
- `StatusCodeLink.INTERNAL_SERVER_ERROR`;
- `StatusCodeLink.NOT_IMPLEMENTED`;
Expand Down Expand Up @@ -97,8 +101,6 @@ dotnet add package PowerUtils.Net.Primitives



## Release Notes

## Changelog

### v1.0.0 - 2021/11/21
- Kick start project
[Here](./CHANGELOG.md)
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "6.0.100"
"version": "6.0.200"
}
}
10 changes: 10 additions & 0 deletions src/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[*.cs]


###############################
# C# Coding Conventions #
###############################


# Code-block preferences
csharp_style_namespace_declarations = block_scoped:suggestion # https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#csharp_style_namespace_declarations
8 changes: 4 additions & 4 deletions src/1.PowerUtils.Net.Primitives.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<!-- Assembly and projecto details -->
Expand All @@ -13,18 +13,18 @@
<PackageId>PowerUtils.Net.Primitives</PackageId>
<title>PowerUtils.Net.Primitives</title>
<Product>PowerUtils.Net.Primitives</Product>
<Version>1.0.0</Version>
<Version>1.1.0</Version>

<Authors>Nelson Nobre</Authors>
<Company>TechNobre</Company>

<License>MIT</License>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<Copyright>Copyright © 2021 by TechNobre</Copyright>
<Copyright>Copyright © 2022 by TechNobre</Copyright>

<Description>Provides additional types and constants for network-based libraries.</Description>
<PackageReleaseNotes>
- Kick start project
- Added constant for Status Code UNPROCESSABLE ENTITY 422
</PackageReleaseNotes>
<Description>Provides additional types and constants for network-based libraries.</Description>
<PackageTags>PowerUtils;Utils;Net;Primitives;Types;Constants;Web</PackageTags>
Expand Down
Loading