Skip to content

Move to using incremental source gen #136

Move to using incremental source gen

Move to using incremental source gen #136

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Build, Test & Package
on:
push:
branches: [ "main" ]
paths-ignore:
- "**/*.md"
- "**/*.gitignore"
- "**/*.gitattributes"
pull_request:
branches: [ "main" ]
paths-ignore:
- "**/*.md"
- "**/*.gitignore"
- "**/*.gitattributes"
jobs:
build:
name: Build, Test & Package
runs-on: ubuntu-latest
steps:
- name: Get source
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Restore dependencies
run: dotnet restore
- name: Build & Package
run: dotnet build --no-restore --configuration Release
- name: Test
run: dotnet test --no-build --verbosity normal --configuration Release
- name: Publish artifacts
uses: actions/upload-artifact@v3
with:
name: nuget-package
path: artifacts/*.nupkg
publish_github:
name: Publish package to GitHub Package Repository
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
# - name: Add GitHub Package Repository source
# run: dotnet nuget add source --username ${{ secrets.GPR_USERNAME }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name GPR ${{ secrets.GPR_URL }}
# - name: Push to GitHub Packages
# run: dotnet nuget push **.nupkg -s "GPR" --skip-duplicate
- name: Push to GitHub package registry
run: |
dotnet nuget push **.nupkg \
--api-key ${{ secrets.GITHUB_TOKEN }} \
--source https://nuget.pkg.github.com/${{ github.repository_owner }}
- name: Delete old packages
uses: smartsquaregmbh/[email protected]
with:
keep: 5
names: Synto
publish_nuget:
name: Publish Package to NuGet.org
if: ${{ github.ref == 'refs/heads/main' }}
needs: build
environment: NuGet.org
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Publish to NuGet.org
run: dotnet nuget push **.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_ORG_API_KEY }}