Skip to content

Merge pull request #16 from proxfield/feature/main/encryption #114

Merge pull request #16 from proxfield/feature/main/encryption

Merge pull request #16 from proxfield/feature/main/encryption #114

Workflow file for this run

name: "Deploy Nuget"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
PROJECT_NAME: Proxfield.Extensions.Caching.SQLite
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}/output
NUGET_SOURCE_URL: https://api.nuget.org/v3/index.json
jobs:
publish:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' # only run job if on the main branch
steps:
- uses: actions/checkout@v2
- name: Setup .Net Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
- name: Restoring Package
run: dotnet restore
- name: Building
run: dotnet build --configuration Release
- name: Create Nuget Package (Without DI)
run: dotnet pack src/${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj --configuration Release --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }} --no-build --include-symbols --no-restore
- name: Create Nuget Package (With DI)
run: dotnet pack src/${{ env.PROJECT_NAME }}.DependencyInjection/${{ env.PROJECT_NAME }}.DependencyInjection.csproj --configuration Release --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }} --no-build --include-symbols --no-restore
- name: Getting project's version
uses: kzrnm/get-net-sdk-project-versions-action@v1
id: get-version
with:
proj-path: src/${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj
- name: Archive Nuget Package
uses: actions/upload-artifact@v1
with:
name: ${{ env.PROJECT_NAME }}
path: ${{ env.PACKAGE_OUTPUT_DIRECTORY }}/${{ env.PROJECT_NAME }}.${{ steps.get-version.outputs.version }}.nupkg
- name: Publish Nuget Package
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}/*.nupkg --api-key ${{ secrets.nuget_api_key }} --source ${{ env.NUGET_SOURCE_URL }} --no-symbols --skip-duplicate