# ASP.NET
# Build and test ASP.NET projects.
# Add steps that publish symbols, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4

trigger:
- main

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

pool:
  vmImage: 'ubuntu-latest' # This default pool will be used for Linux builds

stages:
- stage: Build
  jobs:
  - job: LinuxBuild
    displayName: 'Build on Linux'
    pool:
      vmImage: 'ubuntu-latest' 
    steps:

      - task: UseDotNet@2
        inputs:
          packageType: 'sdk'
          version: '9.0.x'

      - task: NodeTool@0
        inputs:
          versionSource: 'spec'
          versionSpec: '20.x'

      - task: PowerShell@2
        inputs:
          filePath: 'make.ps1'
          arguments: '-OutputDir $(Build.ArtifactStagingDirectory)-linux'

      - task: PublishBuildArtifacts@1
        inputs:
          PathtoPublish: '$(Build.ArtifactStagingDirectory)-linux'
          ArtifactName: 'drop-linux'
          publishLocation: 'Container'


  - job: WindowsBuild
    displayName: 'Build on Windows'
    pool:
      vmImage: 'windows-latest' # Specify the Windows agent
    steps:

      - task: UseDotNet@2
        inputs:
          packageType: 'sdk'
          version: '9.0.x'
          
      - task: NodeTool@0
        inputs:
          versionSource: 'spec'
          versionSpec: '20.x'

      - task: PowerShell@2
        inputs:
          filePath: 'make.ps1'
          arguments: '-OutputDir $(Build.ArtifactStagingDirectory)-windows'

      - task: PublishBuildArtifacts@1
        inputs:
          PathtoPublish: '$(Build.ArtifactStagingDirectory)-windows'
          ArtifactName: 'drop-windows'
          publishLocation: 'Container'




