Skip to content

Merge pull request #9 from KeelMatrix/dependabot/nuget/System.Text.Js… #44

Merge pull request #9 from KeelMatrix/dependabot/nuget/System.Text.Js…

Merge pull request #9 from KeelMatrix/dependabot/nuget/System.Text.Js… #44

Workflow file for this run

name: CI
permissions:
contents: read
on:
push:
branches:
- "**"
tags:
- "v*"
pull_request:
jobs:
validate:
if: github.actor != 'dependabot[bot]'
name: Validate (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup .NET SDKs
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
6.0.x
8.0.x
- name: Restore
run: dotnet restore KeelMatrix.Telemetry.slnx
- name: Build
run: dotnet build KeelMatrix.Telemetry.slnx --configuration Release --no-restore
- name: Test
run: dotnet test KeelMatrix.Telemetry.slnx --configuration Release --no-build
validate-dependabot:
if: github.actor == 'dependabot[bot]'
name: Validate (ubuntu-latest)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup .NET SDKs
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
6.0.x
8.0.x
- name: Restore
run: dotnet restore KeelMatrix.Telemetry.slnx
- name: Build
run: dotnet build KeelMatrix.Telemetry.slnx --configuration Release --no-restore
- name: Test
run: dotnet test KeelMatrix.Telemetry.slnx --configuration Release --no-build
pack:
name: Pack
runs-on: ubuntu-latest
needs:
- validate
- validate-dependabot
if: |
always() &&
!cancelled() &&
(needs.validate.result == 'success' || needs.validate.result == 'skipped') &&
(needs.validate-dependabot.result == 'success' || needs.validate-dependabot.result == 'skipped')
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore KeelMatrix.Telemetry.slnx
- name: Build
run: dotnet build src/KeelMatrix.Telemetry/KeelMatrix.Telemetry.csproj --configuration Release --no-restore
- name: Pack
run: dotnet pack src/KeelMatrix.Telemetry/KeelMatrix.Telemetry.csproj --configuration Release --no-build --include-symbols --p:SymbolPackageFormat=snupkg --output ./artifacts/packages
- name: Upload packages
uses: actions/upload-artifact@v6
with:
name: nuget-packages
path: ./artifacts/packages
if-no-files-found: error
overwrite: true
publish:
name: Publish
runs-on: ubuntu-latest
needs: pack
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- name: Download packages
uses: actions/download-artifact@v6
with:
name: nuget-packages
path: ./artifacts/packages
- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
- name: Push packages to NuGet
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
dotnet nuget push "./artifacts/packages/*.nupkg" --source https://api.nuget.org/v3/index.json --api-key "$NUGET_API_KEY" --skip-duplicate
dotnet nuget push "./artifacts/packages/*.snupkg" --source https://api.nuget.org/v3/index.json --api-key "$NUGET_API_KEY" --skip-duplicate
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
generate_release_notes: true
files: ./artifacts/packages/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}