Merge pull request #11 from Mooshua/workspace #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: Lilikoi.NuGet | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET Core SDK | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '7.0.x' | |
dotnet-quality: 'ga' | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build Lilikoi | |
run: dotnet build Lilikoi --framework netstandard2.0 --configuration Release --no-restore | |
- name: Build Tests | |
run: dotnet build Lilikoi.Tests --framework net7.0 --configuration Release --no-restore | |
- name: Test | |
run: dotnet test Lilikoi.Tests --framework net7.0 --configuration Release --no-build --no-restore --verbosity normal | |
- name: Pack Lilikoi | |
run: dotnet pack Lilikoi --configuration Release --no-build --no-restore | |
- name: Upload package artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: nuget_packages | |
path: ./artifacts/*.nupkg | |
if-no-files-found: error | |
- name: Publish to GitHub | |
run: nuget push ./artifacts/*.nupkg -Source 'https://nuget.pkg.github.com/Mooshua/index.json' -ApiKey ${{secrets.GITHUB_TOKEN}} | |
- name: Publish to NuGet | |
run: nuget push ./artifacts/*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_TOKEN}} |