Skip to content

Bump JsonPointer.Net from 6.0.1 to 7.0.0 #812

Bump JsonPointer.Net from 6.0.1 to 7.0.0

Bump JsonPointer.Net from 6.0.1 to 7.0.0 #812

Workflow file for this run

name: Build, test and publish dotnet
on:
workflow_dispatch:
push:
pull_request:
jobs:
dotnet-build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- name: Setup .NET 8
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.x
- name: Setup .NET 9
uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.x
- name: Setup .NET 10
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x
- name: Restore dependencies
run: dotnet restore
- name: Check formatting
run: dotnet format --verify-no-changes
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Test
run: dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage" --configuration Release
- name: Install report generator
run: dotnet tool install --global dotnet-reportgenerator-globaltool
- name: Pack the project
run: dotnet pack --configuration Release
- name: Generate coverage report
run: reportgenerator -reporttypes:MarkdownSummary -reports:**/coverage.cobertura.xml -targetdir:./reports/coverage
- uses: actions/upload-artifact@v6
with:
name: coverage
path: reports/coverage
- uses: actions/upload-artifact@v6
with:
name: packages
path: src/*/bin/Release/*.*nupkg
- name: Publish coverage report to GitHub Step Summary
run: |
cat reports/coverage/Summary.md >> $GITHUB_STEP_SUMMARY
publish-release-to-nuget:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: dotnet-build
permissions:
id-token: write
contents: write
steps:
- name: Setup .NET 8
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.x
- name: Setup .NET 9
uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.x
- name: Setup .NET 10
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x
- name: Download packages
uses: actions/download-artifact@v7
with:
name: packages
- name: NuGet login
uses: NuGet/login@v1
id: nuget-login
with:
user: ${{ secrets.NUGET_USER }}
- name: Publish to NuGet
run: dotnet nuget push **/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }}
- name: Publish to GitHub Packages
run: gh release upload ${{ github.ref_name }} lib/bin/Release/*.nupkg lib/bin/Release/*.snupkg tool/bin/Release/*.nupkg tool/bin/Release/*.snupkg --repo ${{ github.repository }} --clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker-build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
attestations: write
steps:
- uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha,prefix=sha-{{branch}}
type=raw,value=latest,enable={{is_default_branch}}
- name: Build Docker image
id: build
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Push Docker image
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
- name: Generate artifact attestation
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: actions/attest-build-provenance@v3
with:
subject-name: ghcr.io/${{ github.repository }}
subject-digest: ${{ steps.build.outputs.digest }}
push-to-registry: true