From 7825c2ea30535038c071100dacd82eb6b791c3ff Mon Sep 17 00:00:00 2001 From: Marek Eibel <536376@mail.muni.cz> Date: Wed, 22 Jul 2026 21:09:51 +0200 Subject: [PATCH 1/3] feat: write build-test-release GH action --- .github/workflows/build-test-release.yml | 60 ++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/build-test-release.yml diff --git a/.github/workflows/build-test-release.yml b/.github/workflows/build-test-release.yml new file mode 100644 index 0000000..515f872 --- /dev/null +++ b/.github/workflows/build-test-release.yml @@ -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 + + - name: Build project + run: dotnet build --configuration Release --no-restore + + - name: Run unit tests + run: dotnet test --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 From d2adccb98122d78302e03055f719a60a74f2dc4a Mon Sep 17 00:00:00 2001 From: Marek Eibel <536376@mail.muni.cz> Date: Wed, 22 Jul 2026 21:14:57 +0200 Subject: [PATCH 2/3] fix: error MSB1003: Specify a project or solution file --- .github/workflows/build-test-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-test-release.yml b/.github/workflows/build-test-release.yml index 515f872..008f1aa 100644 --- a/.github/workflows/build-test-release.yml +++ b/.github/workflows/build-test-release.yml @@ -30,13 +30,13 @@ jobs: dotnet-version: "8.0.x" - name: Restore dependencies - run: dotnet restore + run: dotnet restore src/MKCards2/MKCards2.sln - name: Build project - run: dotnet build --configuration Release --no-restore + run: dotnet build src/MKCards2/MKCards2.sln --configuration Release --no-restore - name: Run unit tests - run: dotnet test --configuration Release --no-build --verbosity normal + run: dotnet test src/MKCards2/MKCards2.sln --configuration Release --no-build --verbosity normal # publish-nuget: # name: Publish NuGet Package From 7fe61df6516ea709973911d5dad17b961fa2a3f9 Mon Sep 17 00:00:00 2001 From: Marek Eibel <536376@mail.muni.cz> Date: Wed, 22 Jul 2026 21:17:15 +0200 Subject: [PATCH 3/3] fix: path in action --- .github/workflows/build-test-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-test-release.yml b/.github/workflows/build-test-release.yml index 008f1aa..b0fcd83 100644 --- a/.github/workflows/build-test-release.yml +++ b/.github/workflows/build-test-release.yml @@ -30,13 +30,13 @@ jobs: dotnet-version: "8.0.x" - name: Restore dependencies - run: dotnet restore src/MKCards2/MKCards2.sln + run: dotnet restore MKCards2/MKCards2.sln - name: Build project - run: dotnet build src/MKCards2/MKCards2.sln --configuration Release --no-restore + run: dotnet build MKCards2/MKCards2.sln --configuration Release --no-restore - name: Run unit tests - run: dotnet test src/MKCards2/MKCards2.sln --configuration Release --no-build --verbosity normal + run: dotnet test MKCards2/MKCards2.sln --configuration Release --no-build --verbosity normal # publish-nuget: # name: Publish NuGet Package