-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Create main.yml * build with GitHub Action * Create release.yml * Documentation moved ro README.md * remove cake and build with dotnet build * add dotnet build workflow * add testcoverage * naming * added release * Update Badges * removed comments * add source url for GetBuildVersion * update API and tasks added
- Loading branch information
Showing
18 changed files
with
216 additions
and
249 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,8 @@ | ||
coverage: | ||
status: | ||
project: | ||
default: | ||
informational: true | ||
patch: | ||
default: | ||
informational: true |
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,54 @@ | ||
# This workflow will build TfsUrlParser project | ||
|
||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
- "feature/**" | ||
- "release/**" | ||
- "hotfix/**" | ||
|
||
defaults: | ||
run: | ||
working-directory: src | ||
|
||
jobs: | ||
build: | ||
env: | ||
BUILD_CONFIG: "Debug" | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get Build Version | ||
run: | | ||
Import-Module ..\build\GetBuildVersion.psm1 | ||
Write-Host $Env:GITHUB_REF | ||
$version = GetBuildVersion -VersionString $Env:GITHUB_REF | ||
echo "BUILD_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append | ||
shell: pwsh | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 6.0.x | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Build | ||
run: dotnet build --configuration $BUILD_CONFIG -p:Version=$BUILD_VERSION --no-restore | ||
|
||
- name: Test | ||
run: dotnet test -p:Configuration=$BUILD_CONFIG --no-restore --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage | ||
|
||
- name: Codecov | ||
uses: codecov/codecov-action@v3 |
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,55 @@ | ||
# This workflow will release TfsUrlParser | ||
|
||
name: Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
defaults: | ||
run: | ||
working-directory: src | ||
|
||
jobs: | ||
build: | ||
env: | ||
BUILD_CONFIG: "Release" | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get Build Version | ||
run: | | ||
Import-Module ..\build\GetBuildVersion.psm1 | ||
Write-Host $Env:GITHUB_REF | ||
$version = GetBuildVersion -VersionString $Env:GITHUB_REF | ||
echo "BUILD_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append | ||
shell: pwsh | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 6.0.x | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Build | ||
run: dotnet build --configuration $BUILD_CONFIG -p:Version=$BUILD_VERSION --no-restore | ||
|
||
- name: Test | ||
run: dotnet test -p:Configuration=$BUILD_CONFIG --no-restore --no-build --verbosity normal --collect:"XPlat Code Coverage" | ||
|
||
- name: Codecov | ||
uses: codecov/codecov-action@v1.5.2 | ||
|
||
- name: Setup NuGet | ||
uses: NuGet/setup-nuget@v1 | ||
|
||
- name: Publish NuGet | ||
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGETORG}} |
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,41 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "build", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"build", | ||
"${workspaceFolder}/src/TfsUrlParser.sln", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "publish", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"publish", | ||
"${workspaceFolder}/src/TfsUrlParser/TfsUrlParser.sln", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "watch", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"watch", | ||
"run", | ||
"--project", | ||
"${workspaceFolder}/src/TfsUrlParser/TfsUrlParser.sln" | ||
], | ||
"problemMatcher": "$msCompile" | ||
} | ||
] | ||
} |
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,36 @@ | ||
// https://github.com/MADE-Apps/MADE.NET/blob/main/build/GetBuildVersion.psm1 | ||
|
||
Function GetBuildVersion { | ||
Param ( | ||
[string]$VersionString | ||
) | ||
|
||
# Process through regex | ||
$VersionString -match "(?<major>\d+)(\.(?<minor>\d+))?(\.(?<patch>\d+))?(\-(?<pre>[0-9A-Za-z\-\.]+))?(\+(?<build>\d+))?" | Out-Null | ||
|
||
if ($matches -eq $null) { | ||
return "1.0.0-build" | ||
} | ||
|
||
# Extract the build metadata | ||
$BuildRevision = [uint64]$matches['build'] | ||
# Extract the pre-release tag | ||
$PreReleaseTag = [string]$matches['pre'] | ||
# Extract the patch | ||
$Patch = [uint64]$matches['patch'] | ||
# Extract the minor | ||
$Minor = [uint64]$matches['minor'] | ||
# Extract the major | ||
$Major = [uint64]$matches['major'] | ||
|
||
$Version = [string]$Major + '.' + [string]$Minor + '.' + [string]$Patch; | ||
if ($PreReleaseTag -ne [string]::Empty) { | ||
$Version = $Version + '-' + $PreReleaseTag | ||
} | ||
|
||
if ($BuildRevision -ne 0) { | ||
$Version = $Version + '.' + [string]$BuildRevision | ||
} | ||
|
||
return $Version | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.