Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/build-test-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build, test and release MKCards2

on:
push:
branches: [main, dev, feat-*]
tags:
- "v*.*.*"
pull_request:
branches: [main, dev]
workflow_dispatch:

permissions:
contents: write

jobs:
build-and-test:
name: Test on ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"

- name: Restore dependencies
run: dotnet restore MKCards2/MKCards2.sln

- name: Build project
run: dotnet build MKCards2/MKCards2.sln --configuration Release --no-restore

- name: Run unit tests
run: dotnet test MKCards2/MKCards2.sln --configuration Release --no-build --verbosity normal

# publish-nuget:
# name: Publish NuGet Package
# needs: build-and-test
# runs-on: ubuntu-latest
# if: startsWith(github.ref, 'refs/tags/v')

# steps:
# - name: Checkout code
# uses: actions/checkout@v4

# - name: Setup .NET
# uses: actions/setup-dotnet@v4
# with:
# dotnet-version: "8.0.x"

# - name: Create NuGet Package
# run: dotnet pack src/MKCards2.Core/MKCards2.Core.csproj --configuration Release -o ./nuget_out

# - name: Push to NuGet.org
# run: dotnet nuget push ./nuget_out/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
Loading