diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..02ebfed --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,30 @@ +name: Publish NuGet Package + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '6.0.x' # 필요한 .NET 버전으로 설정 + + - name: Restore dependencies + run: dotnet restore + + - name: Build the project + run: dotnet build --configuration Release --no-restore + + - name: Pack the project + run: dotnet pack --configuration Release --no-build --output ./nupkg + + - name: Publish to NuGet + run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json