Skip to content

Commit

Permalink
Use dotnet-releaser for the ci
Browse files Browse the repository at this point in the history
  • Loading branch information
xoofx committed Feb 25, 2022
1 parent 12914cd commit e5b0ad5
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 33 deletions.
39 changes: 12 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,23 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
with:
with:
submodules: true
fetch-depth: 0

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

- name: Build & test (Release)
run: dotnet test src -c Release

- name: Coverlet
run: dotnet test src -c Release -f net6.0 /p:Include=\"[${{env.PROJECT_NAME}}]*\" /p:CollectCoverage=true /p:CoverletOutputFormat=lcov

- name: Coveralls Upload
uses: coverallsapp/github-action@master
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: src/${{env.PROJECT_NAME}}.Tests/coverage.info

- name: Pack
- name: Build, Test, Pack, Publish
run: |
dotnet pack src -c Release
dotnet pack src/${{env.PROJECT_NAME}}.Signed -c Release
- name: Publish
if: github.event_name == 'push'
run: |
if ( "${{github.ref}}" -match "^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$" ) {
dotnet nuget push src\${{env.PROJECT_NAME}}\bin\Release\*.nupkg -s nuget.org -k ${{secrets.NUGET_TOKEN}}
dotnet nuget push src\${{env.PROJECT_NAME}}.Signed\bin\Release\*.nupkg -s nuget.org -k ${{secrets.NUGET_TOKEN}}
} else {
echo "publish is only enabled by tagging with a release tag"
}
dotnet tool install -g dotnet-releaser
dotnet-releaser run --nuget-token ${{secrets.NUGET_TOKEN}} --github-token ${{secrets.GITHUB_TOKEN}} src/dotnet-releaser.toml
#- name: Coveralls Upload
# uses: coverallsapp/github-action@master
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# path-to-lcov: src/${{env.PROJECT_NAME}}.Tests/coverage.info
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,6 @@ FakesAssemblies/
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions

# dotnet-releaser
artifacts-dotnet-releaser/
7 changes: 1 addition & 6 deletions src/Tomlyn.Tests/Tomlyn.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="nunit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />

<PackageReference Include="coverlet.msbuild" Version="3.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/Tomlyn.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
..\.gitignore = ..\.gitignore
..\changelog.md = ..\changelog.md
..\.github\workflows\ci.yml = ..\.github\workflows\ci.yml
dotnet-releaser.toml = dotnet-releaser.toml
global.json = global.json
..\license.txt = ..\license.txt
..\readme.md = ..\readme.md
Expand Down
7 changes: 7 additions & 0 deletions src/dotnet-releaser.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[msbuild]
project = ["Tomlyn.sln", "Tomlyn.Signed/Tomlyn.Signed.csproj"]
[github]
user = "xoofx"
repo = "Tomlyn"
[coverage]
format = ["cobertura", "lcov"]

0 comments on commit e5b0ad5

Please sign in to comment.