Skip to content

ci(actions): bump github/codeql-action from 4.34.1 to 4.35.3 #147

ci(actions): bump github/codeql-action from 4.34.1 to 4.35.3

ci(actions): bump github/codeql-action from 4.34.1 to 4.35.3 #147

Workflow file for this run

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: publish
on:
workflow_dispatch: # Allow running the workflow manually from the GitHub UI
push:
branches:
- 'main' # Run the workflow when pushing to the main branch
pull_request:
branches:
- '*' # Run the workflow for all pull requests
release:
types:
- published # Run the workflow when a new GitHub release is published
env:
NuGetDirectory: ${{ github.workspace }}/src/*/bin/Release/
permissions: {}
defaults:
run:
shell: pwsh
jobs:
documentation_quality:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
- name: Update Git submodules
run: git submodule update --init --recursive
- name: Run documentation metrics
run: ./scripts/Get-DocumentationMetrics.ps1 -MinimumScore 85 -EnforceMinimum -OutputJsonPath ./.docs/reports/documentation-metrics.json
- name: Upload documentation metrics artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: documentation-metrics
if-no-files-found: error
retention-days: 14
path: ./.docs/reports/documentation-metrics.json
create_nuget:
runs-on: ubuntu-latest
needs: [ documentation_quality ]
permissions:
contents: read # Required for repository checkout.
strategy:
matrix:
dotnet-version: [ '8.0.x' ]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
name: Setup dotnet ${{ matrix.dotnet-version }}
- name: Update Git submodules
run: git submodule update --init --recursive
- uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
with:
dotnet-version: ${{ matrix.dotnet-version }}
# You can test your matrix by printing the current dotnet version
name: Display dotnet version
#run: dotnet --version
# Create the NuGet package in the folder from the environment variable NuGetDirectory
- run: dotnet build --configuration Release
# Publish the NuGet package as an artifact, so they can be used in the following jobs
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: nuget
if-no-files-found: error
retention-days: 7
path: ${{ env.NuGetDirectory }}/*.nupkg
validate_nuget:
runs-on: ubuntu-latest
needs: [ create_nuget ]
steps:
# Install the .NET SDK indicated in the global.json file
- name: Setup .NET
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
# Download the NuGet package created in the previous job
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: nuget
path: ${{ env.NuGetDirectory }}
run_test:
runs-on: ubuntu-latest
permissions:
contents: read # Required for repository checkout.
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
- name: Initialize submodules
run: git submodule update --init --recursive
- name: Setup .NET
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
- name: Run tests
run: dotnet test --configuration Release
deploy:
# Publish only when creating a GitHub Release
# https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository
# You can update this logic if you want to manage releases differently
if: github.event_name == 'release'
runs-on: ubuntu-latest
needs: [ validate_nuget, run_test ]
steps:
# Download the NuGet package created in the previous job
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: nuget
path: ${{ env.NuGetDirectory }}
# Install the .NET SDK indicated in the global.json file
- name: Setup .NET Core
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
# Publish all NuGet packages to NuGet.org
# Use --skip-duplicate to prevent errors if a package with the same version already exists.
# If you retry a failed workflow, already published packages will be skipped without error.
- name: Publish NuGet package
run: |
Get-ChildItem -Path . -Recurse -Include *.nupkg | ForEach-Object {
$nupkgPath = $_.FullName
Write-Host "Pushing $nupkgPath"
dotnet nuget push $nupkgPath --api-key "${{ secrets.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
}