Skip to content

refactor(repo): add release please configs #4

refactor(repo): add release please configs

refactor(repo): add release please configs #4

name: Deploy to NuGet
on:
workflow_dispatch:
push:
branches:
- master
- iss-1
pull_request:
types: [ closed ]
jobs:
release:
# if: github.event.pull_request.merged == true
name: Release Using Release Please
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [6.0]
steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v4
# Set up .NET
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
cache: true
cache-dependency-path: "./UrlboxSDK"
# Restore dependencies
- name: Restore dependencies
run: dotnet restore ./UrlboxSDK
# Run tests
- name: Run tests
run: dotnet test
# https://github.com/googleapis/release-please/blob/72b0ab360c3d6635397e8b02f4d3f9f53932e23c/docs/customizing.md
- name: Create Release
uses: google-github-actions/release-please-action@v4
with:
release-type: simple
target-branch: release-please-test
# deploy:
# needs: release
# if: ${{ needs.release.outputs.release_created == true }}
# name: Deploy to NuGet
# runs-on: ubuntu-latest
# strategy:
# matrix:
# dotnet-version: [6.0]
# steps:
# # Build the project
# - name: Build the project
# run: dotnet build ./UrlboxSDK --configuration Release --no-restore
# # Pack the NuGet package somewhere unique
# - name: Pack NuGet package
# run: dotnet pack --configuration Release --no-build --output ./package
# # Push the NuGet package to NuGet.org
# - name: Publish to NuGet
# run: dotnet nuget push "./package/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json