Skip to content

NuGet Push

NuGet Push #6

Workflow file for this run

name: NuGet Push
on:
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
name: Update NuGet package
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET Core @ Latest
uses: actions/setup-dotnet@v4
- name: Setup JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Extract Version from csproj
id: get_version
run: |
$version = Select-String -Path "./src/Aptabase.Maui.csproj" -Pattern '<Version>(.*)</Version>' | ForEach-Object { $_.Matches.Groups[1].Value }
echo "PackageVersion=$version" | Out-File -Append -FilePath $env:GITHUB_ENV
shell: powershell
- name: Build and Publish
run: |
cd ./src/
dotnet restore Aptabase.Maui.csproj
dotnet pack Aptabase.Maui.csproj -c Release -o artifacts -p:PackageVersion=${{ env.PackageVersion }}
- name: Push
run: dotnet nuget push ./src/artifacts/Aptabase.Maui.${{ env.PackageVersion }}.nupkg -k ${{ secrets.NUGET_APIKEY }} -s https://api.nuget.org/v3/index.json