Skip to content

Build

Build #3

Workflow file for this run

name: Build
on:
workflow_dispatch:
inputs:
publish-nuget:
description: 'Push to Nuget'
type: boolean
default: false
jobs:
build:
defaults:
run:
shell: bash
runs-on: ubuntu-22.04
steps:
- name: Checkout latest
uses: actions/checkout@v5
with:
submodules: 'recursive'
- name: Build
run: dotnet build -c Release
- name: Pack nugets
run: dotnet pack -c Release --no-build --output nupkgs
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: "Project-Babble.Uvc.NET"
path: "nupkgs/*"
- name: Push nupkg to NuGet
if: ${{ github.event.inputs.publish-nuget == 'true' }}
run: |
for nupkg in nupkgs/*.nupkg; do
dotnet nuget push "$nupkg" --source "nuget.org" --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }}
done