Skip to content

Upgrade CI/CD artifact actions to v4 and bump version to 2.0.4 #21

Upgrade CI/CD artifact actions to v4 and bump version to 2.0.4

Upgrade CI/CD artifact actions to v4 and bump version to 2.0.4 #21

Workflow file for this run

name: .NET
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
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: 10.0.x
- name: Restore dependencies
run: dotnet restore BiMap.sln
- name: Build
run: dotnet build --no-restore BiMap.sln --configuration Release
- name: Pack
run: dotnet pack BiMap.csproj --configuration Release --output nuget-packages
- name: Upload NuGet Package
uses: actions/upload-artifact@v4
with:
name: nuget-package
path: nuget-packages/*.nupkg
deploy:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'release'
steps:
- name: Download NuGet Package
uses: actions/download-artifact@v4
with:
name: nuget-package
path: nuget-packages
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 10.0.x
- name: Publish to NuGet
run: dotnet nuget push "nuget-packages/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json