feat: Added Windows and macOS support (#189) #16
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: Create a release on NuGet | |
| on: | |
| push: | |
| tags: | |
| - "v[0-9]+\\.[0-9]+\\.[0-9]+" | |
| - "v[0-9]+\\.[0-9]+\\.[0-9]+-pre" | |
| jobs: | |
| release-nuget: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore | |
| run: dotnet workload restore MAUI.FreakyControls/MAUI.FreakyControls.sln | |
| - name: Verify commit exists in origin/master | |
| shell: pwsh | |
| run: | | |
| git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* | |
| if (-not (git branch --remote --contains | Select-String "origin/master")) { | |
| throw "Tag is not on origin/master. Aborting release." | |
| } | |
| - name: Get version information from tag | |
| id: get_version | |
| shell: pwsh | |
| run: | | |
| $version = "${{ github.ref_name }}".TrimStart("v") | |
| echo "version_without_v=$version" >> $env:GITHUB_OUTPUT | |
| - name: Build | |
| run: dotnet build MAUI.FreakyControls\MAUI.FreakyControls\Maui.FreakyControls.csproj -c Release | |
| - name: Pack NuGet package | |
| run: | | |
| dotnet pack MAUI.FreakyControls\MAUI.FreakyControls\Maui.FreakyControls.csproj -c Release -p:PackageVersion=${{ steps.get_version.outputs.version_without_v }} | |
| - name: Push NuGet package | |
| shell: pwsh | |
| run: | | |
| $version = "${{ steps.get_version.outputs.version_without_v }}" | |
| $nupkgs = Get-ChildItem -Recurse -Filter *.nupkg | Where-Object { | |
| $_.FullName -like "*$version*" -and $_.FullName -notlike "*.symbols.nupkg" | |
| } | |
| if ($nupkgs.Count -ne 1) { | |
| throw "Expected exactly one matching .nupkg, found $($nupkgs.Count)" | |
| } | |
| dotnet nuget push $nupkgs[0].FullName -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} |