build.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. name: Build Solution
  2. on:
  3. push:
  4. branches: [ v2_release, v2_develop ]
  5. paths-ignore:
  6. - '**.md'
  7. pull_request:
  8. branches: [ v2_release, v2_develop ]
  9. paths-ignore:
  10. - '**.md'
  11. workflow_call:
  12. outputs:
  13. artifact-name:
  14. description: "Name of the build artifacts"
  15. value: ${{ jobs.build.outputs.artifact-name }}
  16. jobs:
  17. build:
  18. name: Build Debug & Release
  19. runs-on: ubuntu-latest
  20. outputs:
  21. artifact-name: build-artifacts
  22. timeout-minutes: 10
  23. steps:
  24. - name: Checkout code
  25. uses: actions/checkout@v4
  26. - name: Setup .NET Core
  27. uses: actions/setup-dotnet@v4
  28. with:
  29. dotnet-version: 8.x
  30. dotnet-quality: 'ga'
  31. - name: Restore dependencies
  32. run: dotnet restore
  33. # Suppress CS0618 (member is obsolete) and CS0612 (member is obsolete without message)
  34. # Using -property: syntax with URL-encoded semicolon (%3B) to avoid shell interpretation issues
  35. - name: Build Debug
  36. run: dotnet build --configuration Debug --no-restore -property:NoWarn=0618%3B0612
  37. - name: Build Release Terminal.Gui
  38. run: dotnet build Terminal.Gui/Terminal.Gui.csproj --configuration Release --no-incremental --force -property:NoWarn=0618%3B0612
  39. - name: Pack Release Terminal.Gui
  40. run: dotnet pack Terminal.Gui/Terminal.Gui.csproj --configuration Release --output ./local_packages -property:NoWarn=0618%3B0612
  41. - name: Restore AOT and Self-Contained projects
  42. run: |
  43. dotnet restore ./Examples/NativeAot/NativeAot.csproj -f
  44. dotnet restore ./Examples/SelfContained/SelfContained.csproj -f
  45. - name: Restore Solution Packages
  46. run: dotnet restore
  47. - name: Build Release AOT and Self-Contained
  48. run: |
  49. dotnet build ./Examples/NativeAot/NativeAot.csproj --configuration Release -property:NoWarn=0618%3B0612
  50. dotnet build ./Examples/SelfContained/SelfContained.csproj --configuration Release -property:NoWarn=0618%3B0612
  51. - name: Build Release Solution
  52. run: dotnet build --configuration Release --no-restore -property:NoWarn=0618%3B0612
  53. - name: Upload build artifacts
  54. uses: actions/upload-artifact@v4
  55. with:
  56. name: build-artifacts
  57. path: |
  58. **/bin/Debug/**
  59. **/obj/Debug/**
  60. **/bin/Release/**
  61. **/obj/Release/**
  62. retention-days: 1