Skip to content

Merge pull request #41 from AndreaPic/develop #12

Merge pull request #41 from AndreaPic/develop

Merge pull request #41 from AndreaPic/develop #12

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: NUGET-PUBLISH-RELEASE
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+*'
jobs:
build:
env:
BUILD_CONFIG: 'Release'
SOLUTION: 'DevExtremeAI.sln'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: microsoft/variable-substitution@v1
with:
files: '**/appsettings.json'
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_ORGANIZATION: ${{ secrets.OPENAI_ORGANIZATION }}
- name: Get Build Version
run: |
Import-Module .\build\GetBuildVersion.psm1
Write-Host $Env:GITHUB_REF
$version = GetBuildVersion -VersionString $Env:GITHUB_REF
echo "BUILD_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
shell: pwsh
- name: Setup NuGet
uses: NuGet/setup-nuget@v1.2.0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
7.0.x
6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build $SOLUTION --configuration $BUILD_CONFIG /p:Platform="Any CPU" -p:Version=$BUILD_VERSION --no-restore
- name: Test
run: dotnet test $SOLUTION --no-build --configuration $BUILD_CONFIG /p:Platform="Any CPU" --verbosity normal
- name: Publish
if: startsWith(github.ref, 'refs/tags/')
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}