diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000000..0b9f87b01d1 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,79 @@ +# ASP.NET Core +# Build and test ASP.NET Core projects targeting .NET Core. +# Add steps that run tests, create a NuGet package, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core + +trigger: +- '*' + +pool: + name: 'MyAgentPool' + demands: + - npm + +variables: + buildConfiguration: 'Release' + +steps: +- task: UseDotNet@2 + displayName: 'Use .NET Core SDK 3.1.300' + inputs: + packageType: sdk + version: 3.1.300 + +- task: Npm@1 + displayName: 'Run npm install' + inputs: + verbose: false + +- script: './node_modules/.bin/node-sass Tailspin.SpaceGame.Web/wwwroot --output Tailspin.SpaceGame.Web/wwwroot' + displayName: 'Compile Sass assets' + +- task: gulp@1 + displayName: 'Run gulp tasks' + +- script: 'echo "$(Build.DefinitionName), $(Build.BuildId), $(Build.BuildNumber)" > buildinfo.txt' + displayName: 'Write build info' + workingDirectory: Tailspin.SpaceGame.Web/wwwroot + +- task: DotNetCoreCLI@2 + displayName: 'Restore project dependencies' + inputs: + command: 'restore' + projects: '**/*.csproj' + +- task: DotNetCoreCLI@2 + displayName: 'Build the project - Debug' + inputs: + command: 'build' + arguments: '--no-restore --configuration Debug' + projects: '**/*.csproj' + +- task: DotNetCoreCLI@2 + displayName: 'Publish the project - Debug' + inputs: + command: 'publish' + projects: '**/*.csproj' + publishWebProjects: false + arguments: '--no-build --configuration Debug --output $(Build.ArtifactStagingDirectory)/Debug' + zipAfterPublish: true + +- task: DotNetCoreCLI@2 + displayName: 'Build the project - Release' + inputs: + command: 'build' + arguments: '--no-restore --configuration Release' + projects: '**/*.csproj' + +- task: DotNetCoreCLI@2 + displayName: 'Publish the project - Release' + inputs: + command: 'publish' + projects: '**/*.csproj' + publishWebProjects: false + arguments: '--no-build --configuration Release --output $(Build.ArtifactStagingDirectory)/Release' + zipAfterPublish: true + +- task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: drop' + condition: succeeded()