Merge pull request #92 from bj-rn/fix/binding/intial-value-problem #28
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: push_nuget | |
| on: | |
| push: | |
| # branches: ["develop"] | |
| tags: ["v*"] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Git Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "8.x.x" | |
| - name: Setup Nuget.exe | |
| uses: nuget/setup-nuget@v1 | |
| - name: Build packages | |
| run: | | |
| dotnet build .\VL.Avalonia\src\VL.Avalonia.csproj --configuration Release --output .\VL.Avalonia\lib\net8.0\ | |
| dotnet build .\VL.Avalonia.Skia\src\VL.Avalonia.Skia.csproj --configuration Release --output .\VL.Avalonia.Skia\lib\net8.0\ | |
| dotnet build .\VL.Avalonia.Stride\src\VL.Avalonia.Stride.csproj --configuration Release --output .\VL.Avalonia.Stride\lib\net8.0\ | |
| dotnet build .\VL.Avalonia.Custom\src\VL.Avalonia.Custom.csproj --configuration Release --output .\VL.Avalonia.Custom\lib\net8.0\ | |
| - name: Extract version and detect pre-release | |
| id: version | |
| run: | | |
| $version = "${{ github.ref_name }}" | |
| $cleanVersion = $version.Substring(1) | |
| $isPrerelease = $cleanVersion -match "[\-+]" | |
| $prerelease = "" | |
| if ($isPrerelease -eq "True"){ | |
| $prerelease = "--prerelease" | |
| } | |
| echo "VERSION=$cleanVersion" >> $env:GITHUB_ENV | |
| echo "IS_PRERELEASE=$isPrerelease" >> $env:GITHUB_ENV | |
| echo "PRERELEASE_STRING=$prerelease" >> $env:GITHUB_ENV | |
| - name: Pack packages | |
| run: | | |
| nuget pack .nuget\VL.Avalonia.nuspec -Version ${{ env.VERSION }} -OutputDirectory .\packages | |
| nuget pack .nuget\VL.Avalonia.Skia.nuspec -Version ${{ env.VERSION }} -OutputDirectory .\packages | |
| nuget pack .nuget\VL.Avalonia.Custom.nuspec -Version ${{ env.VERSION }} -OutputDirectory .\packages | |
| nuget pack .nuget\VL.Avalonia.Stride.nuspec -Version ${{ env.VERSION }} -OutputDirectory .\packages | |
| - name: Publish to NuGet.org | |
| run: | | |
| Write-Host "Publishing to NuGet.org..." | |
| foreach ($package in Get-ChildItem -Path ./packages -Filter *.nupkg) { | |
| dotnet nuget push $package ` | |
| --api-key ${{ secrets.NUGET_KEY }} ` | |
| --source https://api.nuget.org/v3/index.json ` | |
| --skip-duplicate ` | |
| ${{ env.PRERELEASE_STRING}} | |
| } | |
| - name: Upload artifacts | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| artifacts: packages/** | |
| generateReleaseNotes: true | |
| allowUpdates: true | |
| prerelease: ${{ env.IS_PRERELEASE == 'True' }} |