Build Package #363
Workflow file for this run
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
name: Build Package | |
on: | |
push: | |
branches: [ "main", release-*, develop ] | |
pull_request: | |
branches: [ "main", release-*, develop ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: 'true' | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.x | |
- name: Build and Pack Nugets | |
run: dotnet pack src/FishyFlip.sln --configuration Release --output nupkg | |
- name: Upload Nuget | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nupkg | |
path: nupkg/*.nupkg | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: 'true' | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.x | |
- name: Run FishyFlip.Tests | |
run: dotnet test src/FishyFlip.Tests/FishyFlip.Tests.csproj -- --report-trx --results-directory ../../dotnet-test-results | |
- name: Run WhiteWindLib.Tests | |
run: dotnet test src/WhiteWindLib.Tests/WhiteWindLib.Tests.csproj -- --report-trx --results-directory ../../dotnet-test-results | |
- name: Upload Test Results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dotnet-test-results | |
path: dotnet-test-results | |
if: ${{ always() }} | |
publish: | |
needs: [build, test] | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/develop' && github.event_name == 'push' | |
steps: | |
- name: Download Nuget Package | |
uses: actions/download-artifact@v4 | |
with: | |
name: nupkg | |
path: nupkg | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.x | |
- name: Publish to NuGet | |
run: | | |
for f in ./nupkg/*.nupkg | |
do | |
dotnet nuget push $f --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
done |