-
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.
- Loading branch information
1 parent
deff6ea
commit bc600c3
Showing
2 changed files
with
54 additions
and
20 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 |
---|---|---|
|
@@ -2,9 +2,7 @@ name: CI | |
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
branches: [ main, dev ] | ||
|
||
jobs: | ||
build: | ||
|
@@ -14,18 +12,35 @@ jobs: | |
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: | | ||
6.0.x | ||
7.0.x | ||
8.0.x | ||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Build | ||
run: dotnet build --no-restore | ||
run: dotnet build -c Release --no-restore /p:ContinuousIntegrationBuild=true | ||
|
||
- name: Test | ||
run: dotnet test --no-build --verbosity normal | ||
run: dotnet test -c Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage | ||
|
||
- name: Code Coverage Report | ||
uses: irongut/[email protected] | ||
if: matrix.os == 'ubuntu-latest' | ||
with: | ||
filename: coverage/**/coverage.cobertura.xml | ||
badge: true | ||
fail_below_min: true | ||
format: text | ||
hide_branch_rate: false | ||
hide_complexity: true | ||
indicators: true | ||
output: both | ||
thresholds: '60 80' |
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 |
---|---|---|
|
@@ -6,40 +6,59 @@ on: | |
|
||
permissions: | ||
contents: write # important for release description edit and asset upload | ||
packages: write | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
build-and-publish: | ||
name: Build and Publish | ||
|
||
runs-on: ubuntu-latest | ||
|
||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set release information | ||
run: gh release edit ${{ github.ref_name }} -n "$(echo -e '***[Pre-release is being automatically created, please wait...](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})***\n\n${{ github.event.release.body }}')" | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: | | ||
7.0.x | ||
6.0.x | ||
8.0.x | ||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Build | ||
run: dotnet build -c Release --no-restore | ||
run: dotnet build -c Release --no-restore /p:ContinuousIntegrationBuild=true | ||
|
||
- name: Test | ||
run: dotnet test -c Release --no-build --verbosity normal | ||
run: dotnet test -c Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage | ||
|
||
- name: Upload the package to this release | ||
run: gh release upload ${{ github.ref_name }} MinimalXmlReader/bin/Release/MinimalXmlReader.*.nupkg | ||
- name: Code Coverage Report | ||
uses: irongut/[email protected] | ||
with: | ||
filename: coverage/**/coverage.cobertura.xml | ||
badge: true | ||
fail_below_min: true | ||
format: text | ||
hide_branch_rate: false | ||
hide_complexity: true | ||
indicators: true | ||
output: both | ||
thresholds: '60 80' | ||
|
||
- name: Publish the package to nuget.org | ||
run: dotnet nuget push MinimalXmlReader/bin/Release/MinimalXmlReader.*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json | ||
|
||
- name: Publish the package to github.com | ||
run: dotnet nuget push MinimalXmlReader/bin/Release/MinimalXmlReader.*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/bigbang1112/index.json | ||
|
||
- name: Upload the package to this release | ||
run: gh release upload ${{ github.ref_name }} MinimalXmlReader/bin/Release/MinimalXmlReader.*.nupkg | ||
|
||
- name: Set release information | ||
run: gh release edit ${{ github.ref_name }} -n "$(echo -e '${{ github.event.release.body }}\n\nAssets were automatically generated using the [publish workflow](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).')" |