From 608c0ddc744a4a6d238da76013e2abbd7f9bacbc Mon Sep 17 00:00:00 2001 From: STAM Date: Sun, 29 Sep 2024 16:30:31 +0300 Subject: [PATCH] test --- .github/workflows/build-and-deploy.yml | 52 ++++++++++++++++++++------ readme.md | 25 +++++++++---- src/kasthack.binding.wf.csproj | 4 +- 3 files changed, 60 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 9cec2d0..6a0d285 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -2,7 +2,7 @@ name: Build and Deploy on: push: - branches: [ master ] + branches: [ master, develop ] pull_request: branches: [ master ] @@ -16,7 +16,8 @@ jobs: strategy: matrix: - configuration: [Debug, Release] +# configuration: [Debug, Release] + configuration: [Debug] steps: - name: Checkout code @@ -30,21 +31,48 @@ jobs: - name: Restore dependencies run: dotnet restore - - name: Patch csproj version + - name: Check current directory and files + run: | + echo "Current Directory: $(pwd)" + echo "Files in current directory:" + ls -Recurse + shell: pwsh + + - name: Update version + id: update_version run: | - $csproj_files = Get-ChildItem -Path '**/*.csproj' - foreach ($file in $csproj_files) { - (Get-Content $file.FullName) -replace '.*', "${{ github.run_number }}" | Set-Content $file.FullName - } + version_file="src/kasthack.binding.wf.csproj" + + current_version=$(Select-String -Path $version_file -Pattern '(.*?)' | ForEach-Object { $_.Matches.Groups[1].Value }) + + build_number=${GITHUB_RUN_NUMBER} + + new_version="${current_version.Split('.')[0..1] -join '.'}.${build_number}" + + pwsh -Command "(Get-Content $version_file) -replace '.*', '$new_version' | Set-Content $version_file" + pwsh -Command "(Get-Content $version_file) -replace '.*', '${new_version}.0' | Set-Content $version_file" + + echo "new_version=$new_version" >> $GITHUB_ENV shell: pwsh - name: Build run: dotnet build --configuration ${{ matrix.configuration }} --verbosity minimal - - name: Publish NuGet package - if: matrix.configuration == 'Release' - run: dotnet pack --configuration Release --output ./nupkg - - name: Push NuGet package +# - name: Publish NuGet package +# if: matrix.configuration == 'Release' +# run: dotnet pack --configuration Release --output ./nupkg + +# - name: Push NuGet package +# if: matrix.configuration == 'Release' +# run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json + + - name: Create GitHub Release if: matrix.configuration == 'Release' - run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ env.new_version }} + name: ${{ env.new_version }} + files: ./nupkg/*.nupkg + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/readme.md b/readme.md index 375276a..4a4b75d 100644 --- a/readme.md +++ b/readme.md @@ -1,19 +1,30 @@ # kasthack.binding.wf -[![Nuget](https://img.shields.io/nuget/v/kasthack.binding.wf.svg)](https://www.nuget.org/packages/kasthack.binding.wf/) -[![NuGet](https://img.shields.io/nuget/dt/kasthack.binding.wf.svg)](https://www.nuget.org/packages/kasthack.binding.wf/) -[![Build status](https://img.shields.io/appveyor/ci/kasthack/kasthack-binding-wf.svg)](https://ci.appveyor.com/project/kasthack/kasthack-binding-wf) -[![license](https://img.shields.io/github/license/kasthack/kasthack.binding.wf.svg)](LICENSE) -[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/kasthack_binding_wf) +[![NuGet Version](https://img.shields.io/nuget/v/kasthack.binding.wf?style=flat-square&link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2Fkasthack.binding.wf)](https://www.nuget.org/packages/kasthack.binding.wf/) +[![NuGet Downloads](https://img.shields.io/nuget/dt/kasthack.binding.wf?style=flat-square&link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2Fkasthack.binding.wf)](https://www.nuget.org/packages/kasthack.binding.wf/) +[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/kasthack-labs/kasthack.binding.wf/build-and-deploy.yml?style=flat-square&link=https%3A%2F%2Fgithub.com%2Fkasthack-labs%2Fkasthack.binding.wf%2Factions%2Fworkflows%2Fbuild-and-deploy.yml)](https://github.com/kasthack-labs/kasthack.binding.wf/actions/workflows/build-and-deploy.yml) +[![GitHub License](https://img.shields.io/github/license/kasthack-labs/kasthack.binding.wf?style=flat-square&link=LICENSE.md)](LICENSE.md) +[![GitHub repo size](https://img.shields.io/github/repo-size/kasthack-labs/kasthack.binding.wf?style=flat-square&link=https%3A%2F%2Fgithub.com%2Fkasthack-labs%2F)](https://github.com/kasthack-labs/) +[![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/kasthack-labs/kasthack.binding.wf/total?style=flat-square&link=https%3A%2F%2Fgithub.com%2Fkasthack-labs%2Fkasthack.binding.wf%2Freleases)](https://github.com/kasthack-labs/releases) -## What +## About -Windows.Forms data binding lambda helper. Gets rid of that literal / nameof bullshit in your code. +Windows.Forms data binding lambda helper. Gets rid of that literal / nameof in your code. ## Installation +### CLI + `Install-Package kasthack.binding.wf` +### dotNet 5+ + +`dotnet add package kasthack.binding.wf` + +### Direct in project via PackageReference + +`` + ## Usage `control.Bind(a=>a.ControlProperty, model, a=>a.ModelProperty.ModelSubProperty)` diff --git a/src/kasthack.binding.wf.csproj b/src/kasthack.binding.wf.csproj index cf3e323..4f6651f 100644 --- a/src/kasthack.binding.wf.csproj +++ b/src/kasthack.binding.wf.csproj @@ -12,8 +12,8 @@ https://github.com/kasthack/kasthack.binding.wf/blob/master/LICENSE.md http://github.com/kasthack/kasthack.binding.wf true - 1.2.2 - 1.2.2.0 + 1.3.0 + 1.3.0.0