Release #53
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: Release | |
| on: workflow_dispatch | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| NuGetDirectory: ${{ github.workspace}}/nuget | |
| defaults: | |
| run: | |
| shell: pwsh | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| defaults: | |
| run: | |
| working-directory: src | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| filter: tree:0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Restore workloads | |
| run: dotnet workload restore | |
| - name: Install android workload | |
| run: dotnet workload install android | |
| - name: Install ios workload | |
| run: dotnet workload install ios | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --no-restore | |
| - name: Create nuget package | |
| run: dotnet pack --configuration Release --output ${{ env.NuGetDirectory }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: nuget | |
| if-no-files-found: error | |
| retention-days: 7 | |
| path: ${{ env.NuGetDirectory }}/*.nupkg | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: [ build ] | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: nuget | |
| path: ${{ env.NuGetDirectory }} | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| - name: Publish NuGet package | |
| run: | | |
| foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) { | |
| dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate | |
| } | |