Publish NuGet #10
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: Publish NuGet | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| pack-and-publish: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: | |
| 10.0.x | |
| - name: Install MAUI workload | |
| run: dotnet workload install maui | |
| - name: Build | |
| run: dotnet build BarcodeScanning.Native.Maui/BarcodeScanning.Native.Maui.csproj -c Release | |
| - name: Pack | |
| run: dotnet pack --no-build BarcodeScanning.Native.Maui/BarcodeScanning.Native.Maui.csproj -c Release -o "${{ github.workspace }}/nupkgs" | |
| - name: Publish to NuGet | |
| run: | | |
| cd "${{ github.workspace }}/nupkgs" | |
| dotnet nuget push "*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json |