Update to support .NET 7 #4
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: Build and publish package | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
branches: [ master ] | |
env: | |
PROJECT_PATH: 'Framework.Data/Framework.Data.csproj' | |
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}\output | |
NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json' | |
jobs: | |
deploy: | |
name: 'Deploy' | |
runs-on: 'windows-latest' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# Install the .NET Core workload | |
- name: Install .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.x | |
- name: 'Restore packages' | |
run: dotnet restore ${{ env.PROJECT_PATH }} | |
- name: 'Build project' | |
run: dotnet build ${{ env.PROJECT_PATH }} --no-restore --configuration Release | |
- name: 'Pack project' | |
run: dotnet pack ${{ env.PROJECT_PATH }} --no-restore --no-build --configuration Release --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }} | |
- name: 'Push package' | |
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}\*.nupkg --api-key ${{ secrets.NUGET_AUTH_TOKEN }} --source ${{ env.NUGET_SOURCE_URL }} --skip-duplicate |