Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
57 changed files
with
715 additions
and
595 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,109 @@ | ||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | ||
|
||
name: 'CI' | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- 'main' | ||
pull_request: | ||
branches: | ||
- '*' | ||
release: | ||
types: | ||
- published | ||
|
||
env: | ||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | ||
DOTNET_NOLOGO: true | ||
NuGetDirectory: ${{ github.workspace}}/nuget | ||
|
||
defaults: | ||
run: | ||
shell: pwsh | ||
|
||
jobs: | ||
create_nuget: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Get all history to allow automatic versioning using MinVer | ||
|
||
- name: Setup .NET # Install the .NET SDK indicated in the global.json file | ||
uses: actions/setup-dotnet@v3 | ||
|
||
|
||
- name: Release Pack (update release notes) | ||
if: github.event_name == 'release' | ||
env: | ||
RELEASE_NAME: ${{ github.event.release.name }} | ||
RELEASE_BODY: ${{ github.event.release.body }} | ||
run: | | ||
$name = $env:RELEASE_NAME | ||
$body = $env:RELEASE_BODY | ||
$releaseNotes = "# Release ${{ github.event.release.tag_name }}" | ||
if($name){ | ||
$releaseNotes = $releaseNotes + " - " + $name | ||
} | ||
if($body){ | ||
$releaseNotes = $releaseNotes + "`r`n`r`n" + $body | ||
} | ||
Write-Host "`tSetting release notes to '$releaseNotes'" | ||
dotnet pack --configuration Release --output ${{ env.NuGetDirectory }} -p:PackageReleaseNotes=$releaseNotes | ||
- name: Non-release Pack | ||
if: github.event_name != 'release' | ||
run: dotnet pack --configuration Release --output ${{ env.NuGetDirectory }} | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: nuget | ||
if-no-files-found: error | ||
retention-days: 7 | ||
path: ${{ env.NuGetDirectory }}/*.nupkg | ||
|
||
run_test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
- name: Run tests | ||
run: dotnet test --configuration Release --logger "trx;LogFilePrefix=T" | ||
- name: Upload test results | ||
uses: actions/upload-artifact@v3 | ||
if: success() || failure() # run this step even if previous step failed | ||
with: | ||
name: TestResult | ||
if-no-files-found: error | ||
retention-days: 7 | ||
path: "**/*.trx" | ||
|
||
deploy: | ||
if: github.event_name == 'release' || (github.event_name == 'push' && github.ref_name == 'main') | ||
runs-on: ubuntu-latest | ||
needs: [ create_nuget, run_test ] | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: nuget | ||
path: ${{ env.NuGetDirectory }} | ||
|
||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v3 | ||
|
||
- name: Publish NuGet package | ||
env: | ||
EVENT_NAME: ${{ github.event_name }} | ||
run: | | ||
$key = ($env:EVENT_NAME -eq 'release') ? "${{ secrets.NUGET_API_KEY }}" : "${{ secrets.GH_PACKAGE_REGISTRY_API_KEY }}" | ||
$source = ($env:EVENT_NAME -eq 'release') ? "https://api.nuget.org/v3/index.json" : "https://nuget.pkg.github.com/MichalBrylka/index.json" | ||
foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) { | ||
dotnet nuget push $file --api-key "$key" --source "$source" --skip-duplicate | ||
} |
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,27 @@ | ||
name: License Scanning | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
defaults: | ||
run: | ||
shell: pwsh | ||
|
||
|
||
jobs: | ||
scan: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout tree | ||
uses: actions/checkout@v4 | ||
|
||
|
||
|
||
- name: Run FOSSA scan and upload build data | ||
uses: fossa-contrib/fossa-action@v3 | ||
with: | ||
fossa-api-key: ${{ secrets.FOSSA_API_KEY }} |
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,21 @@ | ||
name: 'Test Report' | ||
on: | ||
workflow_run: | ||
workflows: ['CI'] | ||
types: | ||
- completed | ||
|
||
run-name: "Test for '${{ github.event.workflow_run.head_commit.message }}'" | ||
|
||
jobs: | ||
report: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: dorny/test-reporter@v1 | ||
with: | ||
artifact: 'TestResult' | ||
name: "Tests results" | ||
reporter: dotnet-trx | ||
path: "**/*.trx" | ||
fail-on-error: 'true' | ||
fail-on-empty: '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
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
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
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
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
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
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
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
Oops, something went wrong.