Build and pack. Run 294.1 #294
This file contains hidden or 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 workflow will build a .NET project | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
| name: NuGet Packages Release Build | |
| run-name: Build and pack. Run ${{ github.run_number }}.${{ github.run_attempt }} | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| - 'release/**' | |
| - 'feature/**' | |
| pull_request: | |
| types: | |
| - opened | |
| branches: | |
| - 'release/**' | |
| - 'feature/**' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Build & pack | |
| run: | | |
| dotnet build --configuration Release -p:Git2SemVer_HostType=GitHub -p:Git2SemVer_BuildNumber=${{ env.RUN_NUMBER }} -p:Git2SemVer_BuildContext=${{ env.RUN_ATTEMPT }} | |
| env: | |
| RUN_NUMBER: ${{ github.run_number }} | |
| RUN_ATTEMPT: ${{ github.run_attempt }} | |
| - name: Run tests | |
| run: | | |
| dotnet test --verbosity normal --configuration Release --no-build | |
| - name: Archive Git2SemVer.MSBuild NuGet package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Git2SemVer.MSBuild.nupkg (github run ${{ github.run_number }}.${{ github.run_attempt }}) | |
| path: artifacts/*.nupkg | |
| compression-level: 0 | |
| if-no-files-found: error | |