Pack and push package with nexus #8
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 push package with nexus" | |
on: | |
workflow_dispatch: | |
inputs: | |
packageVersion: | |
description: "Package Version" | |
required: true | |
type: string | |
env: | |
NUGET_REGISTRY: http://220.165.143.67:8081/repository/nuget-hosted/ | |
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.DataEncryption | |
# 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.NexusNugetKey }} | |
publish-dir: "./nupkg" | |
# - name: Setup PowerShell | |
# uses: microsoft/setup-powershell@v1 | |
# - 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 and pack with dotnet | |
# # run: dotnet build --configuration Release | |
# shell: pwsh | |
# run: | | |
# ./nupkg/nuget-pack.ps1 | |
# - name: publish nuget package | |
# uses: dansiegel/publish-nuget@v1.2 | |
# with: | |
# filename: "./nupkg/*.nupkg" | |
# apiKey: ${{ secrets.NexusNugetKey }} | |
# feedUrl: ${{ env.NUGET_REGISTRY }} | |
# - name: Install Nuget | |
# uses: nuget/setup-nuget@v1 | |
# with: | |
# nuget-version: "5.x" | |
# - name: Push package to Nexus registry | |
# run: | | |
# nuget push .\nupkg\*.nupkg -Source ${{ env.NUGET_REGISTRY }} -SkipDuplicate -ApiKey ${ { secrets.NexusNugetKey } } -NoSymbols |