Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Publish nupkgs to NuGet feed/package repository

on:
push:
tags:
- 'v*'

jobs:
build-and-publish:
environment: dotnet
permissions:
id-token: write

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v7.0.0
with:
submodules: true

- name: Setup .NET
uses: actions/setup-dotnet@v6.0.0
with:
dotnet-version: 10.0.x

- name: Install dependencies
run: dotnet restore

- name: Build packages
run: dotnet pack -c Release -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg

- name: NuGet login
uses: NuGet/login@v1
id: login
with:
user: "${{ vars.NUGET_USERNAME }}"

- name: Push NuGet packages
run: |
for pkg in $(find . -name '*.nupkg'); do
case "$pkg" in
*Avalonia*)
echo "Skipping $pkg"
continue
;;
esac

dotnet nuget push "$pkg" \
--api-key "${{ steps.login.outputs.NUGET_API_KEY }}" \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
done

- name: Push symbol packages
run: |
for pkg in $(find . -name '*.snupkg'); do
case "$pkg" in
*Avalonia*)
echo "Skipping $pkg"
continue
;;
esac

dotnet nuget push "$pkg" \
--api-key "${{ steps.login.outputs.NUGET_API_KEY }}" \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
done
Loading