Publish to NuGet #154
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: "Publish to NuGet" | |
on: | |
workflow_dispatch: | |
# push: | |
# branches: [ "master" ] | |
# pull_request: | |
# branches: [ "master" ] | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
# Checkout | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
#Setup .NET Core | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
source-url: https://api.nuget.org/v3/index.json | |
env: | |
NUGET_AUTH_TOKEN: ${{secrets.NUGET_AUTH_TOKEN}} | |
# Setup Node.js | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16.13.0 | |
# Npm Install and build Cases UI | |
- name: NPM Install and Build Cases UI | |
run: | | |
cd src/Indice.Features.Cases.App | |
npm install --force | |
npm run build:template | |
# Npm Install and build Admin UI | |
- name: NPM Install and Build Admin UI | |
run: | | |
cd src/Indice.Features.Identity.AdminUI.App | |
npm install --force | |
npm run build:template | |
# Npm Install and build Messages UI | |
- name: NPM Install and Build Messages UI | |
run: | | |
cd src/Indice.Features.Messages.App | |
npm install --force | |
npm run build:template | |
#Create .nuget dir | |
- name: Create .nuget dir | |
shell: pwsh | |
run: | | |
if (!(Test-Path -Path ".\.nuget" )) | |
{ | |
New-Item -ItemType "directory" -Path ".\.nuget" | |
} | |
if (!(Test-Path -Path ".\.nuget\packages" )) | |
{ | |
New-Item -ItemType "directory" -Path ".\.nuget\packages" | |
} | |
# Build and pack | |
- name: Build solution and generate NuGet package | |
run: ./pack.ps1 | |
# Push to NuGet | |
- name: Push generated package to GitHub registry | |
run: dotnet nuget push '**/Indice*.nupkg' --skip-duplicate -k ${{ secrets.NUGET_AUTH_TOKEN }} |