Skip to content

Publish Packages

Publish Packages #4

Workflow file for this run

name: Publish Packages
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: |
dotnet restore src/Spoleto.VirtualKassa.MultiBank/Spoleto.VirtualKassa.MultiBank.csproj
dotnet restore src/Spoleto.VirtualKassa.MultiBank.Extensions/Spoleto.VirtualKassa.MultiBank.Extensions.csproj
- name: Build
run: |
dotnet build src/Spoleto.VirtualKassa.MultiBank/Spoleto.VirtualKassa.MultiBank.csproj --configuration Release --no-restore
dotnet build src/Spoleto.VirtualKassa.MultiBank.Extensions/Spoleto.VirtualKassa.MultiBank.Extensions.csproj --configuration Release --no-restore
# Pack packages
- name: Pack Spoleto.VirtualKassa.MultiBank
run: dotnet pack --include-symbols -p:SymbolPackageFormat=snupkg --no-build -c Release src/Spoleto.VirtualKassa.MultiBank/Spoleto.VirtualKassa.MultiBank.csproj -o .
- name: Pack Spoleto.VirtualKassa.MultiBank.Extensions
run: dotnet pack --include-symbols -p:SymbolPackageFormat=snupkg --no-build -c Release src/Spoleto.VirtualKassa.MultiBank.Extensions/Spoleto.VirtualKassa.MultiBank.Extensions.csproj -o .
# Push packages to Nuget
- name: Push packages
run: dotnet nuget push *.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate
# Upload packages as release assets
- name: Upload assets to release
run: |
chmod +x ./publish-assets-to-github.sh
./publish-assets-to-github.sh ${{ github.event.release.tag_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}