Skip to content

docs: Update build status badge to CI workflow on GitHub #18

docs: Update build status badge to CI workflow on GitHub

docs: Update build status badge to CI workflow on GitHub #18

Workflow file for this run

name: Continuous Integration
on:
push:
branches:
- main
- develop
pull_request:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Display .NET information
run: dotnet --info
- name: Build solution
run: dotnet build --configuration Release
- name: Run unit tests
run: dotnet test ./test/Moniker.Tests --configuration Release --no-build --no-restore
- name: Run approval tests
run: dotnet test ./test/Moniker.ApprovalTests --configuration Release --no-build --no-restore
- name: Create NuGet packages
run: dotnet pack --configuration Release
- name: Publish NuGet packages to GitHub Packages
if: github.event_name == 'push'
run: |
dotnet nuget add source \
--username alexmg \
--password ${{ secrets.GITHUB_TOKEN }} \
--store-password-in-clear-text \
--name github \
https://nuget.pkg.github.com/alexmg/index.json
dotnet nuget push '**/*.nupkg' \
--source github \
--api-key ${{ secrets.GITHUB_TOKEN }}
- name: Publish NuGet packages to NuGet.org
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: |
dotnet nuget push '**/*.nupkg' \
--source 'https://api.nuget.org/v3/index.json' \
--api-key ${{ secrets.NUGET_API_KEY }}