Merge pull request #3 from atc-net/feature/release-please #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release-please | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
steps: | |
- name: release-please | |
id: release | |
uses: googleapis/release-please-action@v4 | |
with: | |
token: ${{ secrets.RELEASE_PLEASE_PAT }} | |
- name: 🛒 Checkout repository | |
if: ${{ steps.release.outputs.release_created }} | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.RELEASE_PLEASE_PAT }} | |
- name: ⚙️ Setup dotnet 8.0.x | |
if: ${{ steps.release.outputs.release_created }} | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
- name: 🧹 Clean | |
if: ${{ steps.release.outputs.release_created }} | |
run: dotnet clean -c Release && dotnet nuget locals all --clear | |
- name: 🔁 Restore packages | |
if: ${{ steps.release.outputs.release_created }} | |
run: dotnet restore | |
- name: 🛠️ Building library in release mode | |
if: ${{ steps.release.outputs.release_created }} | |
run: dotnet build -c Release --no-restore /p:UseSourceLink=true | |
- name: 🗳️ Creating library package for release | |
if: ${{ steps.release.outputs.release_created }} | |
run: dotnet pack -c Release --no-restore -o ${GITHUB_WORKSPACE}/packages /p:PublicRelease=true | |
- name: 📦 Push packages to NuGet | |
if: ${{ steps.release.outputs.release_created }} | |
run: | | |
dotnet nuget push ${GITHUB_WORKSPACE}/packages/*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols |