Add name to artifact #11
This file contains 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: .NET | |
on: | |
push: | |
branches: [ main, 'v[0-9].**' ] | |
pull_request: | |
branches: [ main, 'v[0-9].**' ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
filter: tree:0 | |
- name: Install .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Restore dependencies | |
run: dotnet restore BlazorBindings.Avalonia.sln | |
- name: Build templates | |
run: | | |
cd templates | |
dotnet build -c Release | |
cd .. | |
- name: Pack nugets | |
run: dotnet pack -o ./packages -c Release --no-restore | |
- name: Upload a Build Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: packages | |
path: packages | |
publish-to-nuget: | |
needs: build | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: packages | |
path: packages | |
- name: Push to NuGet | |
run: | | |
dotnet nuget push **/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate |