Skip to content

Bump Microsoft.AspNetCore.Authentication.Certificate and 26 others #111

Bump Microsoft.AspNetCore.Authentication.Certificate and 26 others

Bump Microsoft.AspNetCore.Authentication.Certificate and 26 others #111

Workflow file for this run

name: Build and Push NuGet Packages
on:
push:
branches:
- master
paths:
- .github/workflows/main.yml
- src/**/*
- Directory.Build.props
pull_request:
branches:
- master
types:
- opened
- reopened
- synchronize
paths:
- .github/workflows/main.yml
- src/**/*
- Directory.Build.props
workflow_dispatch:
repository_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
SOLUTION: "Convey.slnx"
BUILD_CONFIG: "Release"
PACKAGE_SOURCE: "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
steps:
- name: Checkout Source
uses: actions/checkout@v6
- name: Get .NET Version from Directory.Build.props
id: dotnet_version
shell: bash
run: |
# 1. Grep the line, extracting only the matched segment
# 2. Sed capture group to get the digit after 'net'
MAJOR_VERSION=$(grep -oP '<TargetFramework>.*</TargetFramework>' Directory.Build.props | sed -E 's/.*net([0-9]+).*/\1/')
echo "Detected .NET Major Version: $MAJOR_VERSION"
# 3. Write to GitHub Output
echo "major=$MAJOR_VERSION" >> $GITHUB_OUTPUT
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ steps.dotnet_version.outputs.major }}
dotnet-quality: "ga"
- name: Get Year
id: year
uses: josStorer/get-current-time@v2
with:
format: YY
- name: Build
run: |
VERSION="${{ steps.year.outputs.formattedTime }}.${{ steps.dotnet_version.outputs.major }}.${{ github.run_number }}"
dotnet build \
$SOLUTION \
--configuration $BUILD_CONFIG \
--verbosity minimal \
--property:Version="$VERSION" \
--property:ContinuousIntegrationBuild=true \
--property:Deterministic=true \
--property:DeterministicSourcePaths=true \
--property:SourceLinkCreate=true \
--property:DebugType=pdbonly \
--property:IncludeSymbols=true \
--property:SymbolPackageFormat=snupkg
- name: Run Tests
run: |
dotnet test \
--configuration $BUILD_CONFIG \
--no-restore \
--no-build \
--verbosity minimal
- name: Publish Packages
if: github.event_name != 'pull_request'
run: |
dotnet nuget push \
**\*.nupkg \
--source $PACKAGE_SOURCE \
--api-key ${{ secrets.GITHUB_TOKEN }} \
--skip-duplicate
- name: Publish Symbols
if: github.event_name != 'pull_request'
run: |
dotnet nuget push \
**\*.snupkg \
--source $PACKAGE_SOURCE \
--api-key ${{ secrets.GITHUB_TOKEN }} \
--skip-duplicate