Skip to content

Build Maurosoft.Blazor.Components.Spinner #14

Build Maurosoft.Blazor.Components.Spinner

Build Maurosoft.Blazor.Components.Spinner #14

Workflow file for this run

name: Build Maurosoft.Blazor.Components.Spinner
on:
push:
branches: [main]
paths: [ 'src/Spinner/**' ]
pull_request:
branches: [main]
paths: [ 'src/Spinner/**' ]
workflow_dispatch:
inputs:
configuration:
type: choice
description: The build configuration to use in the deploy stage.
required: true
default: Release
options:
- Debug
- Release
env:
TIMEZONE: 'Europe/Rome'
CONFIGURATION: 'Release'
PROJECT_PATH: ./src/Spinner
PROJECT_NAME: Maurosoft.Blazor.Components.Spinner.csproj
PACKAGE_NAME: Maurosoft.Blazor.Components.Spinner
BUILD_ARTIFACT: Maurosoft.Blazor.Components.Spinner
jobs:
build:
name: 🛠️ Build
runs-on: ubuntu-latest
outputs:
version: ${{ steps.nbgv.outputs.SemVer2 }}
steps:
- name: Checkout
uses: maurosoft1973/gha-git-checkout@v1
- name: Install .NET
uses: maurosoft1973/gha-dotnet-install@v1
- name: Nerdbank.GitVersioning
uses: dotnet/nbgv@v0.4
id: nbgv
with:
path: ${{ env.PROJECT_PATH }}
- name: Restore Dependencies
uses: maurosoft1973/gha-dotnet-restore@v1
- name: Build for ${{ env.PROJECT_NAME }} (${{ env.CONFIGURATION }})
uses: maurosoft1973/gha-dotnet-build@v1
with:
projects: ${{ env.PROJECT_PATH }}/${{ env.PROJECT_NAME }}
configuration: ${{ env.CONFIGURATION }}
uploadBuildArtifactName: ${{ env.BUILD_ARTIFACT }}
pack:
name: 📦 Pack
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Install .NET
uses: maurosoft1973/gha-dotnet-install@v1
- name: Pack for ${{ env.PACKAGE_NAME }} - ${{ env.CONFIGURATION }}
uses: maurosoft1973/gha-dotnet-pack@v1
with:
downloadArtifactName: ${{ env.BUILD_ARTIFACT }}
level: 'normal'
packageName: ${{ env.PACKAGE_NAME }}
packageVersion: ${{ needs.build.outputs.version }}
projects: ${{ env.PROJECT_PATH }}/${{ env.PROJECT_NAME }}
uploadPackedArtifact: true
deploy:
name: 🚀 Deploy Pack v.${{ needs.build.outputs.version }}
runs-on: ubuntu-latest
needs: [build,pack]
environment: Production
steps:
- name: Download ${{ env.PACKAGE_NAME }}.nupkg
uses: actions/download-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }}.${{ needs.build.outputs.version }}.nupkg
- name: Install .NET
uses: maurosoft1973/gha-dotnet-install@v1
- name: Publish NuGet package
run: dotnet nuget push '${{ github.workspace }}/*.nupkg' --api-key "${{ secrets.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate