publish.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. name: Publish Terminal.Gui v1
  2. on:
  3. push:
  4. branches: [ v1_release, v1_develop ]
  5. tags:
  6. - v*
  7. paths-ignore:
  8. - '**.md'
  9. jobs:
  10. publish:
  11. name: Build and Publish to Nuget.org
  12. runs-on: ubuntu-latest
  13. steps:
  14. - uses: actions/checkout@v4
  15. with:
  16. fetch-depth: 0 # fetch-depth is needed for GitVersion
  17. - name: Setup .NET Core
  18. uses: actions/setup-dotnet@v4
  19. with:
  20. dotnet-version: 8.x
  21. dotnet-quality: 'ga'
  22. - name: Install GitVersion
  23. uses: gittools/actions/gitversion/[email protected]
  24. with:
  25. versionSpec: '6.0.x'
  26. - name: Determine Version
  27. uses: gittools/actions/gitversion/[email protected]
  28. with:
  29. useConfigFile: true
  30. updateAssemblyInfo: true
  31. id: gitversion # step id used as reference for output values
  32. - name: Install dependencies
  33. run: dotnet restore
  34. - name: Build Release
  35. run: |
  36. dotnet build Terminal.Gui/Terminal.Gui.csproj --no-incremental --nologo --force --configuration Release
  37. dotnet test Terminal.Gui/Terminal.Gui.csproj --configuration Release
  38. - name: Pack
  39. run: dotnet pack Terminal.Gui/Terminal.Gui.csproj -c Release --include-symbols -p:Version='${{ steps.gitversion.outputs.SemVer }}'
  40. # - name: Test to generate Code Coverage Report
  41. # run: |
  42. # sed -i 's/"stopOnFail": false/"stopOnFail": true/g' UnitTests/xunit.runner.json
  43. # dotnet test --verbosity normal --collect:"XPlat Code Coverage" --settings UnitTests/coverlet.runsettings
  44. # mv -v UnitTests/TestResults/*/*.* UnitTests/TestResults/
  45. # - name: Create Test Coverage Badge
  46. # uses: simon-k/[email protected]
  47. # id: create_coverage_badge
  48. # with:
  49. # label: Unit Test Coverage
  50. # color: brightgreen
  51. # path: UnitTests/TestResults/coverage.opencover.xml
  52. # gist-filename: code-coverage.json
  53. # gist-id: 90ef67a684cb71db1817921a970f8d27
  54. # gist-auth-token: ${{ secrets.GIST_AUTH_TOKEN }}
  55. # - name: Print Code Coverage
  56. # run: |
  57. # echo "Code coverage percentage: ${{steps.create_coverage_badge.outputs.percentage}}%"
  58. # echo "Badge data: ${{steps.create_coverage_badge.outputs.badge}}"
  59. - name: Publish to NuGet.org
  60. run: dotnet nuget push Terminal.Gui/bin/Release/Terminal.Gui.${{ steps.gitversion.outputs.SemVer }}.nupkg --api-key ${{ secrets.NUGET_API_KEY }}