Skip to content

Merge pull request #125 from Gml-Launcher/dependabot/nuget/src/Gml.Co… #86

Merge pull request #125 from Gml-Launcher/dependabot/nuget/src/Gml.Co…

Merge pull request #125 from Gml-Launcher/dependabot/nuget/src/Gml.Co… #86

Workflow file for this run

name: Publish NuGet Package
on:
push:
branches: [ master, develop ]
tags: [ 'v*.*.*', 'v*.*', 'v*.*.*-alpha*', 'v*.*-alpha*' ]
jobs:
validate:
runs-on: ubuntu-latest
env:
FORGE_TOKEN: ${{ secrets.FORGE_TOKEN }}
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build Gml.Core.sln --configuration Release
- name: Test
run: dotnet test Gml.Core.sln --configuration Release --no-build --verbosity normal
publish:
needs: validate
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
env:
NUGET_IGNORE_FAILED_SOURCES: 'true'
FORGE_TOKEN: ${{ secrets.FORGE_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
source-url: https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
- name: Restore dependencies
run: dotnet restore
- name: Build and pack interfaces
run: |
dotnet build src/Gml.Interfaces/Gml.Interfaces.csproj --configuration Release
dotnet pack src/Gml.Interfaces/Gml.Interfaces.csproj --configuration Release --no-build --output ./nupkgs
- name: Build and pack common
run: |
dotnet build src/Gml.Common/Gml.Common/Gml.Common.csproj --configuration Release
dotnet pack src/Gml.Common/Gml.Common/Gml.Common.csproj --configuration Release --no-build --output ./nupkgs
- name: Build and pack domains
run: |
dotnet build src/Gml.Domains/Gml.Domains.csproj --configuration Release
dotnet pack src/Gml.Domains/Gml.Domains.csproj --configuration Release --no-build --output ./nupkgs
- name: Build and pack dto
run: |
dotnet build src/Gml.Dto/Gml.Dto.csproj --configuration Release
dotnet pack src/Gml.Dto/Gml.Dto.csproj --configuration Release --no-build --output ./nupkgs
- name: Build and pack core
run: |
dotnet build src/Gml.Core/Gml.Core.csproj --configuration Release
dotnet pack src/Gml.Core/Gml.Core.csproj --configuration Release --no-build --output ./nupkgs
- name: Add local NuGet source
run: dotnet nuget add source "./nupkgs" --name LocalPackages
- name: Build full solution
run: dotnet build Gml.Core.sln --configuration Release
- name: Publish to NuGet.org
run: dotnet nuget push "./nupkgs/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate