diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 23402e427df..c0462d34c8c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,3 +1,67 @@ -pool: MyAgentPool +trigger: +- '*' + +pool: + vmImage: ubuntu-latest + +variables: + buildConfiguration: 'Release' + steps: -- bash: echo hello world \ No newline at end of file +- task: UseDotNet@2 + displayName: 'Use .NET SDK 6.x' + inputs: + packageType: sdk + version: '8.x' + +# Install Node 16 (node-sass doesn’t support Node 18+ or 20+) +- task: NodeTool@0 + displayName: 'Use Node.js 16.x' + inputs: + versionSpec: '16.x' + +# Install Node.js dependencies +- task: Npm@1 + displayName: 'Run npm install' + inputs: + verbose: false + +# Compile SCSS to CSS +- script: './node_modules/.bin/node-sass Tailspin.SpaceGame.Web/wwwroot --output Tailspin.SpaceGame.Web/wwwroot' + displayName: 'Compile Sass assets' + +# Run gulp tasks +- task: Gulp@1 + displayName: 'Run gulp tasks' + +# Write build metadata +- script: 'echo "$(Build.DefinitionName), $(Build.BuildId), $(Build.BuildNumber)" > buildinfo.txt' + displayName: 'Write build info' + workingDirectory: Tailspin.SpaceGame.Web/wwwroot + +# Restore and build .NET project +- task: DotNetCoreCLI@2 + displayName: 'Restore project dependencies' + inputs: + command: 'restore' + projects: '**/*.csproj' + +- 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() \ No newline at end of file