Skip to content

Publish NuGet

Publish NuGet #4

Workflow file for this run

name: Publish NuGet
on:
workflow_dispatch:
jobs:
pack-and-publish:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version:
10.0.x
- name: Install MAUI workload
run: dotnet workload install maui
- name: Restore
run: dotnet restore BarcodeScanning.Native.Maui/BarcodeScanning.Native.Maui.csproj
- name: Build
run: dotnet build BarcodeScanning.Native.Maui/BarcodeScanning.Native.Maui.csproj -c Release
- name: Pack
run: dotnet pack 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