Skip to content

Pack and push package with nuget #2

Pack and push package with nuget

Pack and push package with nuget #2

Workflow file for this run

name: "Pack and push package with nuget"
on:
workflow_dispatch:
inputs:
packageVersion:
description: "Package Version"
required: true
type: string
env:
NUGET_REGISTRY: https://api.nuget.org/v3/index.json
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Echo build and push config info
run: |
echo "Nuget registry: $Nuget_Registry"
echo "Package version: $Package_Version"
env:
Nuget_Registry: ${{ env.NUGET_REGISTRY }}
Package_Version: ${{ inputs.packageVersion }}
- name: Checkout
uses: actions/checkout@v3
- name: Install dotnet tool
run: dotnet tool install -g dotnetCampus.TagToVersion
- name: Set tag to version
run: dotnet TagToVersion -t ${{ inputs.packageVersion }} -f Version.props
- name: Build with dotnet
run: dotnet build --configuration Release
#- name: Build
#run: dotnet build --configuration Release /p:Version=${VERSION}
- name: Create Nuget Packages
uses: EasyDesk/action-dotnet-pack@v1.0.3
with:
project-names: |
src/X.Captcha
src/X.EntityFrameworkCore.FieldEncryption
src/X.Swashbuckle
# NuGet Package Version
package-version: ${{ inputs.packageVersion }}
output-dir: "./nupkg"
- name: Push Nuget Packages
uses: EasyDesk/action-nuget-push@v1.0.0
with:
nuget-url: ${{ env.NUGET_REGISTRY }}
# The Nuget API key.
nuget-api-key: ${{ secrets.NugetKey }}
publish-dir: "./nupkg"