From 75aef87e1aecfe3a2f1b822b1008ed52ffd8df0c Mon Sep 17 00:00:00 2001 From: jefim Date: Mon, 30 Jun 2025 12:36:14 +0300 Subject: [PATCH 1/2] Initial GitHub CI implementation --- .github/workflows/release.yml | 50 +++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 32 ++++++++++++++++++++++ Frends.Web/Frends.Web.csproj | 5 ++-- 3 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a89e2a0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +name: Release + +on: + workflow_dispatch: + # Allows manual triggering of the workflow + push: + branches: + - master + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '6.0.x' + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Test + run: dotnet test --configuration Release --no-build --verbosity normal + + - name: Get version from project + id: get_version + run: | + VERSION=$(dotnet run --project Frends.Web -- --version 2>/dev/null || echo "1.0.0") + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Pack NuGet package + run: dotnet pack Frends.Web/Frends.Web.csproj --configuration Release --no-build --output ./artifacts + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + tag_name: v${{ steps.get_version.outputs.version }} + name: Release v${{ steps.get_version.outputs.version }} + files: ./artifacts/*.nupkg + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..96d7298 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,32 @@ +name: CI + +on: + workflow_dispatch: + # Allows manual triggering of the workflow + push: + branches-ignore: + - master + pull_request: + branches: + - master + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '6.0.x' + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --no-restore + + - name: Test + run: dotnet test --no-build --verbosity normal \ No newline at end of file diff --git a/Frends.Web/Frends.Web.csproj b/Frends.Web/Frends.Web.csproj index 2dd2d1b..1adbff1 100644 --- a/Frends.Web/Frends.Web.csproj +++ b/Frends.Web/Frends.Web.csproj @@ -4,8 +4,9 @@ netstandard2.0;net471 true HiQ Finland - HiQ Finland - FRENDS Web tasks + Frends + Frends Web tasks (legacy) + 1.2.60 From 18fb326b90bbdb7be5b244cf5945d1a42f088517 Mon Sep 17 00:00:00 2001 From: jefim Date: Mon, 30 Jun 2025 12:38:57 +0300 Subject: [PATCH 2/2] Make tests run in .NET 6 --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a89e2a0..7b20e59 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,7 @@ jobs: run: dotnet build --configuration Release --no-restore - name: Test - run: dotnet test --configuration Release --no-build --verbosity normal + run: dotnet test --configuration Release --no-build --verbosity normal --framework net6.0 - name: Get version from project id: get_version diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 96d7298..f4bdef7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,4 +29,4 @@ jobs: run: dotnet build --no-restore - name: Test - run: dotnet test --no-build --verbosity normal \ No newline at end of file + run: dotnet test --no-build --verbosity normal --framework net6.0 \ No newline at end of file