name: .NET
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
DOTNET_NOLOGO: true
jobs:
build:
# If this library depends on the windows API, you should use the windows latest runner.
# Otherwise, you can use the ubuntu latest runner.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore ./src/
- name: Build
run: dotnet build -c Release --no-restore ./src/
- name: Test
run: dotnet test -c Release --no-build --verbosity normal ./src/
- name: Copy Artifacts
run: |
mkdir ./nuget/
cp ./src/**/bin/Release/*.nupkg ./nuget/
- uses: actions/upload-artifact@v4
with:
name: nuget
if-no-files-found: error
retention-days: 7
path: ./nuget/
필요에 의해서 새로 만든 GitHub Action 템플릿입니다. 프로젝트에 NuGet 패키지 빌드 자동 생성이 켜져있다는 가정 아래에서 만든 템플릿인데, 필요에 따라 조금씩 수정해서 사용하시면 좋을 것 같아 공유해봅니다!