Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build pipeline #8022

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
58 changes: 56 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,57 @@
pool: MyAgentPool
# A build task can compile source code, run unit tests, deploy an application
# to a staging environment, and more.
# amend the version in the code, from 6.x to 8.x

# pool: MyAgentPool
# steps:
# - bash: echo hello world

trigger:
- '*'

pool:
vmImage: ubuntu-latest

variables:
buildConfiguration: 'Release'
wwwrootDir: 'Tailspin.SpaceGame.Web/wwwroot'
dotnetSdkVersion: '8.x'

steps:
- bash: echo hello world
- task: UseDotNet@2
displayName: 'Use .NET SDK $(dotnetSdkVersion)'
inputs:
version: '$(dotnetSdkVersion)'

- task: Npm@1
displayName: 'Run npm install'
inputs:
verbose: false

- script: './node_modules/.bin/node-sass $(wwwrootDir) --output $(wwwrootDir)'
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: $(wwwrootDir)

- task: DotNetCoreCLI@2
displayName: 'Restore project dependencies'
inputs:
command: 'restore'
projects: '**/*.csproj'

- template: templates/build.yml
parameters:
buildConfiguration: 'Debug'

- template: templates/build.yml
parameters:
buildConfiguration: 'Release'

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
condition: succeeded()
Empty file added build.yml
Empty file.
20 changes: 20 additions & 0 deletions templates/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
parameters:
buildConfiguration: 'Release'

steps:
- task: DotNetCoreCLI@2
displayName: 'Build the project - ${{ parameters.buildConfiguration }}'
inputs:
command: 'build'
arguments: '--no-restore --configuration ${{ parameters.buildConfiguration }}'
projects: '**/*.csproj'

- task: DotNetCoreCLI@2
displayName: 'Publish the project - ${{ parameters.buildConfiguration }}'
inputs:
command: 'publish'
projects: '**/*.csproj'
publishWebProjects: false
arguments: '--no-build --configuration ${{ parameters.buildConfiguration }} --output $(Build.ArtifactStagingDirectory)/${{ parameters.buildConfiguration }}'
zipAfterPublish: true