Skip to content

Merge branch 'main' into eduard/rename-cache-keys #16

Merge branch 'main' into eduard/rename-cache-keys

Merge branch 'main' into eduard/rename-cache-keys #16

Workflow file for this run

name: Publish NuGet Package
on: [push]
jobs:
build:
runs-on: ubuntu-latest
name: Update NuGet
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v3
with:
dotnet-version: "6.0"
# Install GitVersion to automatically create a semantic
# version from your repository:
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: "5.x"
# Run GitVersion (set an ID to later fetch values)
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
- run: dotnet build src/wam-core-library.sln -c Release /p:AssemblyVersion=${{ steps.gitversion.outputs.assemblySemFileVer }} /p:FileVersion=${{ steps.gitversion.outputs.assemblySemFileVer }} /p:InformationalVersion=${{ steps.gitversion.outputs.Sha }}
- run: dotnet test src/wam-core-library.sln
- run: dotnet pack src/Wam.Core/Wam.Core.csproj -c Release -p:AssemblyVersion=${{ steps.gitversion.outputs.assemblySemFileVer }} -p:FileVersion=${{ steps.gitversion.outputs.assemblySemFileVer }} -p:InformationalVersion=${{ steps.gitversion.outputs.Sha }} -p:PackageVersion=${{ steps.gitversion.outputs.MajorMinorPatch }}
- name: Publish Artifact
uses: actions/upload-artifact@v3
with:
name: nuget-package
path: src/Wam.Core/bin/Release/*${{ steps.gitversion.outputs.MajorMinorPatch }}.nupkg
deploy:
needs: [build]
runs-on: ubuntu-latest
name: Deploy NuGet Package
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Setup NuGet
uses: NuGet/[email protected]
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: nuget-package
path: ./package
- name: Publish
run: nuget push package/*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}