Skip to content

Bump xunit.runner.visualstudio in /InternetRelayChat.Tests #95

Bump xunit.runner.visualstudio in /InternetRelayChat.Tests

Bump xunit.runner.visualstudio in /InternetRelayChat.Tests #95

Workflow file for this run

name: CI
on:
push:
paths:
- '**'
branches:
- '**'
tags:
- '*.*.*'
workflow_dispatch:
jobs:
build-test:
name: Build & Test
runs-on: ubuntu-22.04
permissions:
contents: read
packages: read
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
- name: Add GitHub Packages source
if: ${{ github.event_name != 'pull_request' && !startsWith( github.ref_name, 'dependabot/' ) }}
run: dotnet nuget add source --name github --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
- name: Restore dependencies
run: dotnet restore
- name: Build projects
run: dotnet build --nologo --configuration Release --no-restore
- name: Run tests
run: dotnet test --nologo --configuration Release --no-build
- name: Launch examples
run: dotnet run --configuration Release --no-build --project InternetRelayChat.Examples/InternetRelayChat.Examples.csproj
- name: Package library
run: dotnet pack --nologo --configuration Release --no-build InternetRelayChat/InternetRelayChat.csproj
- name: Upload package artifact
uses: actions/upload-artifact@v4
with:
name: viral32111.InternetRelayChat
path: |
InternetRelayChat/bin/Release/net7.0/*
InternetRelayChat/bin/Release/*.nupkg
- name: Upload examples artifact
uses: actions/upload-artifact@v4
with:
name: viral32111.InternetRelayChat.Examples
path: InternetRelayChat.Examples/bin/Release/net7.0/*
- name: Upload tests artifact
uses: actions/upload-artifact@v4
with:
name: viral32111.InternetRelayChat.Tests
path: InternetRelayChat.Tests/bin/Release/net7.0/*
publish:
name: Publish
runs-on: ubuntu-22.04
needs: build-test
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
permissions:
contents: read
packages: write
steps:
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
- name: Download package artifact
uses: actions/download-artifact@v4
with:
name: viral32111.InternetRelayChat
path: InternetRelayChat
- name: Add GitHub Packages source
run: dotnet nuget add source --name github --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
- name: Push to GitHub Packages
run: dotnet nuget push --source github --skip-duplicate --api-key ${{ secrets.GITHUB_TOKEN }} InternetRelayChat/viral32111.InternetRelayChat.*.nupkg
- name: Push to NuGet Gallery
run: dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} InternetRelayChat/viral32111.InternetRelayChat.*.nupkg
release:
name: Release
runs-on: ubuntu-22.04
needs: build-test
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
permissions:
contents: write
steps:
- name: Download package artifact
uses: actions/download-artifact@v4
with:
name: viral32111.InternetRelayChat
path: InternetRelayChat
- name: Download examples artifact
uses: actions/download-artifact@v4
with:
name: viral32111.InternetRelayChat.Examples
path: InternetRelayChat.Examples
- name: Download tests artifact
uses: actions/download-artifact@v4
with:
name: viral32111.InternetRelayChat.Tests
path: InternetRelayChat.Tests
- name: Bundle package artifact
run: zip -r viral32111.InternetRelayChat.zip InternetRelayChat
- name: Bundle examples artifact
run: zip -r viral32111.InternetRelayChat.Examples.zip InternetRelayChat.Examples
- name: Bundle tests artifact
run: zip -r viral32111.InternetRelayChat.Tests.zip InternetRelayChat.Tests
- name: Create draft release
uses: softprops/action-gh-release@v2
with:
draft: true
tag_name: ${{ github.ref_name }}
files: viral32111.InternetRelayChat*.zip
token: ${{ secrets.GITHUB_TOKEN }}