diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7b20e59 --- /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 --framework net6.0 + + - 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..f4bdef7 --- /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 --framework net6.0 \ 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