Skip to content

.net 8

.net 8 #83

Workflow file for this run

name: Publish NuGet
on:
push:
branches:
- master
paths:
- '.github/workflows/publish-nuget.yml'
- 'src/BUTR.NativeAOT.Shared/**/*'
- 'src/BUTR.NativeAOT.Generator/**/*'
- 'src/BUTR.NativeAOT.Analyzer.Shared/**/*'
- 'src/BUTR.NativeAOT.Analyzer/**/*'
- 'src/BUTR.NativeAOT.Analyzer.CodeFixes/**/*'
- 'src/BUTR.NativeAOT.Analyzer.Package/**/*'
workflow_dispatch:
jobs:
publish:
name: Publish on NuGet and GPR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.0.2
with:
fetch-depth: 0
- name: Setup .NET 7
uses: actions/setup-dotnet@master
with:
dotnet-version: 7.x.x
- run: dotnet pack -c Release src/BUTR.NativeAOT.Shared -p:VersionOverride=$(git rev-list --no-merges --count master) -o ./packages;
- run: dotnet pack -c Release src/BUTR.NativeAOT.Generator -p:VersionOverride=$(git rev-list --no-merges --count master) -o ./packages;
- run: |
dotnet build -c Release src/BUTR.NativeAOT.Analyzer.Package -p:VersionOverride=$(git rev-list --no-merges --count master);
dotnet pack -c Release src/BUTR.NativeAOT.Analyzer.Package -p:VersionOverride=$(git rev-list --no-merges --count master) -o ./packages;
- name: Push to NuGet
run: dotnet nuget push "./packages/*.nupkg" -k ${{secrets.NUGET_API_KEY}} -s https://www.nuget.org --skip-duplicate
shell: pwsh
- name: Push to GPR
run: |
for f in ./packages/*.nupkg
do
curl -vX PUT -u "vslee:${{secrets.GITHUB_TOKEN}}" -F package=@$f https://nuget.pkg.github.com/BUTR/
done