diff --git a/.github/workflows/publish-nuget.yaml b/.github/workflows/publish-nuget.yaml new file mode 100644 index 00000000..d7c62d32 --- /dev/null +++ b/.github/workflows/publish-nuget.yaml @@ -0,0 +1,65 @@ +name: publish +on: + push: + branches: + - master + tags: + - "*" + + +jobs: + build-and-publish-nuget: + name: build and publish nuget + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 # get full History to make sure tags are included an thus git-describe works + + - name: Get version number + id: version + uses: PaulHatch/semantic-version@v5.2.1 + + - name: Generate semver version number + id: generate-version + shell: powershell + run: | + if("${{ steps.version.outputs.is_tagged }}" -eq "false") + { + $semver_version = "${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }}-beta.${{ steps.version.outputs.increment }}" + } + else + { + $semver_version = "${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }}" + } + + $assembly_version = "${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }}.${{ steps.version.outputs.increment }}" + + echo assembly-version=${assembly_version} >> $env:GITHUB_OUTPUT + echo semantic-version=${semver_version} >> $env:GITHUB_OUTPUT + + - name: Setup .NET Core @ Latest + uses: actions/setup-dotnet@v3 + with: + source-url: https://nuget.pkg.github.com/renewedvision/index.json + env: + NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + + - name: Build + id: build + shell: powershell + run: | + dotnet publish ExtendedWPFToolkitSolution/Xceed.Wpf.Toolkit.sln -restore -p:RestorePackagesConfig=true -p:Version="${{ steps.generate-version.outputs.semantic-version }}" -p:AssemblyVersion="${{ steps.generate-version.outputs.assembly-version }}" -t:Rebuild -p:Configuration=Release + + - name: Package + id: package + run: | + dotnet pack -Version ${{ steps.generate-version.outputs.semantic-version }} -Properties NuGetBinaries=src\x64\release + + - name: Publish Nuget to GitHub registry + shell: powershell + run: | + foreach($file in (Get-ChildItem . -Recurse -Include *.nupkg)) { + dotnet nuget push $file --skip-duplicate + } diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Xceed.Wpf.Toolkit.csproj b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Xceed.Wpf.Toolkit.csproj index c4e9813e..1b7ef7a8 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Xceed.Wpf.Toolkit.csproj +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/Xceed.Wpf.Toolkit.csproj @@ -1,145 +1,141 @@  - - net8.0-windows - Library - false - true - true - - - - RenewedVision.Xceed.Wpf.Toolkit - 3.4.0 - True - https://github.com/renewedvision/wpftoolkit - git - README.md - RenewedVision.Xceed.Wpf.Toolkit - Xceed, RenewedVision - https://github.com/renewedvision/wpftoolkit - MS-PL - true - - - - - - - True - \ - - - True - \ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + net8.0-windows + Library + false + true + true + + + + RenewedVision.Xceed.Wpf.Toolkit + 3.4.0 + True + https://github.com/renewedvision/wpftoolkit + git + README.md + RenewedVision.Xceed.Wpf.Toolkit + Xceed, RenewedVision + https://github.com/renewedvision/wpftoolkit + MS-PL + true + + + + + + + True + \ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file