Skip to content

Version number

Version number #16

# name: NuGet Generation
# on:
# workflow_run:
# workflows: [Run Tests]
# types: [completed]
# jobs:
# on-success:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# proj: [Monitoring, Monitoring.Web]
# defaults:
# run:
# working-directory: ./src
# name: Update NuGet package - ${{ matrix.proj }}
# env:
# PACKAGE_PROJECT_DIR: DR.Common.${{ matrix.proj }}
# PACKAGE_PROJECT_NAME: DR.Common.${{ matrix.proj }}
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# with:
# ref: ${{ github.event.workflow_run.head_branch }}
# - name: Setup .NET Core @ Latest
# uses: actions/setup-dotnet@v2
# with:
# source-url: https://nuget.pkg.github.com/drdk/index.json
# env:
# NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
# - name: Get branch name
# id: branch-name
# uses: tj-actions/branch-names@v5
# - name: Running on a pull request branch, so get branch name to add to Version
# if: steps.branch-name.outputs.is_default == 'false'
# run: |
# echo "PR_BRANCH_NAME=-${{ steps.branch-name.outputs.current_branch }}" >> $GITHUB_ENV
# - name: Update project file version
# uses: jacobtomlinson/gha-find-replace@v3
# with:
# find: '(<Version>\d+\.\d+)\.(\d+)(<)'
# replace: '$1.${{ github.run_number }}${{ env.PR_BRANCH_NAME }}$3'
# include: './Directory.Build.props'
# # Force GeneratePackageOnBuild to false since dotnet pack does not build when
# # it is true (https://github.com/dotnet/sdk/issues/10335)
# - name: Build solution and generate NuGet package
# run: |
# dotnet pack './${{ env.PACKAGE_PROJECT_DIR }}/${{ env.PACKAGE_PROJECT_NAME }}.csproj' -c Release -o out /p:GeneratePackageOnBuild=false
# # Skip duplicates since GPR does not support symbols in a separate nupkg file
# - name: Push generated package to GitHub registry
# run: dotnet nuget push ./out/*.nupkg --skip-duplicate
# on-failure:
# runs-on: ubuntu-latest
# if: ${{ github.event.workflow_run.conclusion == 'failure' }}
# steps:
# - run: echo 'The triggering workflow failed'