📦 Update NuGet packages (#10) #12
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: Merge Pull Requests into 'main' | |
on: | |
push: | |
branches: [main] | |
permissions: | |
packages: write | |
env: | |
DOTNET_NOLOGO: true | |
jobs: | |
build_and_create_a_nuget: | |
name: Build and create a BETA NuGet package (GPR) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Build version prefix/suffix | |
run: | | |
echo "VERSION_PREFIX=${{ github.run_number }}.0.0" >> $GITHUB_ENV | |
echo "VERSION_SUFFIX=beta" >> $GITHUB_ENV | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
- run: dotnet restore --verbosity minimal | |
- run: dotnet build --configuration Release -p:ContinuousIntegrationBuild=true -p:VersionPrefix=$VERSION_PREFIX --version-suffix $VERSION_SUFFIX | |
- run: dotnet pack --configuration Release --no-build --output ./artifacts -p:VersionPrefix=$VERSION_PREFIX --version-suffix $VERSION_SUFFIX -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg | |
- name: Publish artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: NuGetPackage.${{ env.VERSION_PREFIX }}-${{ env.VERSION_SUFFIX }}.nupkg.zip | |
path: ./artifacts/* | |
- name: Publish to GPR | |
run: | | |
dotnet nuget push "./artifacts/*.nupkg" \ | |
--no-symbols \ | |
--api-key ${{ secrets.GITHUB_TOKEN }} \ | |
--source https://nuget.pkg.github.com/${{ github.repository_owner }} |