This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
Aggiornati pacchetti Nuget #29
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 Pack EntityFrameworkCore | |
on: | |
push: | |
branches: [ main ] | |
paths: [ 'GestioneSagre.EFCore/**' ] | |
workflow_dispatch: | |
env: | |
NET_VERSION: '6.x' | |
PROJECT_NAME: GestioneSagre.EFCore | |
PROJECT_FILE: GestioneSagre.EFCore.csproj | |
TAG_NAME: EFCore | |
RELEASE_NAME: GestioneSagre.EFCore | |
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true | |
jobs: | |
build: | |
name: Publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.0 | |
with: | |
fetch-depth: 0 # avoid shallow clone so nbgv can do its work. | |
- name: Setup .NET Core SDK ${{ env.NET_VERSION }} | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ env.NET_VERSION }} | |
- name: Nerdbank.GitVersioning | |
uses: dotnet/nbgv@v0.4 | |
id: nbgv | |
with: | |
path: ${{ env.PROJECT_NAME }} | |
- name: Package | |
run: dotnet pack -c Release -o . '${{ env.PROJECT_NAME }}/${{ env.PROJECT_FILE }}' -p:Version=${{ steps.gitversion.outputs.SemVer }} | |
- name: Publish on NuGet | |
run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --no-symbols --skip-duplicate | |
- name: publish on github | |
run: | | |
dotnet nuget add source --username USERNAME --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" | |
dotnet nuget push **\*.nupkg --source github --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate | |
- name: Create release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.TAG_NAME }}_v${{ steps.nbgv.outputs.NuGetPackageVersion }} | |
release_name: ${{ env.RELEASE_NAME }} ${{ steps.nbgv.outputs.NuGetPackageVersion }} | |
draft: false | |
prerelease: false |