From 2079a6fe5f8c53ae9aa526cdddf8b2d00228cb4a Mon Sep 17 00:00:00 2001 From: Stevens <109077037+ztevens@users.noreply.github.com> Date: Fri, 8 Aug 2025 12:42:30 +0100 Subject: [PATCH 01/10] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 23402e427df..118eb99d243 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,3 +1,12 @@ -pool: MyAgentPool +trigger: +- main + +pool: + vmImage: MyAgentPool + +variables: + buildConfiguration: 'Release' steps: +- script: dotnet build --configuration $(buildConfiguration) + displayName: 'dotnet build $(buildConfiguration)' - bash: echo hello world \ No newline at end of file From 7f299aca4cf2c3d68e16fdbb9a0dfeb8a8b59fcd Mon Sep 17 00:00:00 2001 From: Stevens <109077037+ztevens@users.noreply.github.com> Date: Fri, 8 Aug 2025 12:46:08 +0100 Subject: [PATCH 02/10] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 118eb99d243..1e537d1b28d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,10 +2,11 @@ trigger: - main pool: - vmImage: MyAgentPool + vmImage: ubuntu-latest variables: buildConfiguration: 'Release' + steps: - script: dotnet build --configuration $(buildConfiguration) displayName: 'dotnet build $(buildConfiguration)' From f55da1fa534eac2c5eaa3f0f7fdfc440ccdac193 Mon Sep 17 00:00:00 2001 From: ztevens Date: Fri, 8 Aug 2025 13:05:15 +0100 Subject: [PATCH 03/10] Add build tasks --- azure-pipelines.yml | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1e537d1b28d..bff32a0f67e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,5 +1,5 @@ trigger: -- main +- '*' pool: vmImage: ubuntu-latest @@ -8,6 +8,36 @@ variables: buildConfiguration: 'Release' steps: -- script: dotnet build --configuration $(buildConfiguration) - displayName: 'dotnet build $(buildConfiguration)' -- bash: echo hello world \ No newline at end of file +- task: UseDotNet@2 + displayName: 'Use .NET SDK 6.x' + inputs: + packageType: sdk + version: '6.x' + +- 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 - Release' + inputs: + command: 'build' + arguments: '--no-restore --configuration Release' + projects: '**/*.csproj' \ No newline at end of file From 29b62c5d5551a235c10b8c80f35a6ba075ecc1d6 Mon Sep 17 00:00:00 2001 From: ztevens Date: Fri, 8 Aug 2025 13:21:15 +0100 Subject: [PATCH 04/10] Add build tasks --- azure-pipelines.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bff32a0f67e..cdc2c042836 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -19,7 +19,10 @@ steps: inputs: verbose: false -- script: './node_modules/.bin/node-sass Tailspin.SpaceGame.Web/wwwroot --output Tailspin.SpaceGame.Web/wwwroot' +# Replace node-sass with sass compilation +- script: | + npm install -g sass + sass Tailspin.SpaceGame.Web/wwwroot:Tailspin.SpaceGame.Web/wwwroot --no-source-map --style=compressed displayName: 'Compile Sass assets' - task: gulp@1 From 377661349a0fbc555de8188ce46bd86ead9c9c1c Mon Sep 17 00:00:00 2001 From: ztevens Date: Fri, 8 Aug 2025 13:27:22 +0100 Subject: [PATCH 05/10] change node-sass to sass --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7a7e91aea3c..be600c6bc4e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "gulp-clean-css": "^4.2.0", "gulp-concat": "2.6.1", "gulp-uglify": "3.0.0", - "node-sass": "^7.0.1", + "sass": "^1.72.0", "rimraf": "2.6.1" } } From fe027052327beb7be3db218e1db55d09f5c1c27e Mon Sep 17 00:00:00 2001 From: ztevens Date: Fri, 8 Aug 2025 13:34:50 +0100 Subject: [PATCH 06/10] change net6.0 to 8.0 --- azure-pipelines.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cdc2c042836..522dc643ae8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -9,10 +9,11 @@ variables: steps: - task: UseDotNet@2 - displayName: 'Use .NET SDK 6.x' + displayName: 'Use .NET SDK 8.x' inputs: packageType: sdk - version: '6.x' + version: '8.x' # or '8.0.x' for a specific version + includePreviewVersions: false - task: Npm@1 displayName: 'Run npm install' From 03726d76e905a1a8093d975549006c2df333c96a Mon Sep 17 00:00:00 2001 From: ztevens Date: Fri, 8 Aug 2025 13:43:56 +0100 Subject: [PATCH 07/10] adding publish tasks --- azure-pipelines.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 522dc643ae8..84d8c1eaa59 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -44,4 +44,17 @@ steps: inputs: command: 'build' arguments: '--no-restore --configuration Release' - projects: '**/*.csproj' \ No newline at end of file + 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 From a18c2b15e75d9e4731f270a6b64dbf256aa7ca9f Mon Sep 17 00:00:00 2001 From: ztevens Date: Fri, 8 Aug 2025 14:46:33 +0100 Subject: [PATCH 08/10] adding variables --- azure-pipelines.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 84d8c1eaa59..f15295c1f35 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,14 +6,14 @@ pool: variables: buildConfiguration: 'Release' + wwwrootDir: 'Tailspin.SpaceGame.Web/wwwroot' + dotnetSdkVersion: '8.x' steps: - task: UseDotNet@2 - displayName: 'Use .NET SDK 8.x' + displayName: 'Use .NET SDK $(dotnetSdkVersion)' inputs: - packageType: sdk - version: '8.x' # or '8.0.x' for a specific version - includePreviewVersions: false + version: '$(dotnetSdkVersion)' - task: Npm@1 displayName: 'Run npm install' @@ -21,9 +21,7 @@ steps: verbose: false # Replace node-sass with sass compilation -- script: | - npm install -g sass - sass Tailspin.SpaceGame.Web/wwwroot:Tailspin.SpaceGame.Web/wwwroot --no-source-map --style=compressed +- script: './node_modules/.bin/node-sass $(wwwrootDir) --output $(wwwrootDir)' displayName: 'Compile Sass assets' - task: gulp@1 @@ -31,7 +29,7 @@ steps: - script: 'echo "$(Build.DefinitionName), $(Build.BuildId), $(Build.BuildNumber)" > buildinfo.txt' displayName: 'Write build info' - workingDirectory: Tailspin.SpaceGame.Web/wwwroot + workingDirectory: $(wwwrootDir) - task: DotNetCoreCLI@2 displayName: 'Restore project dependencies' @@ -40,19 +38,19 @@ steps: projects: '**/*.csproj' - task: DotNetCoreCLI@2 - displayName: 'Build the project - Release' + displayName: 'Build the project - $(buildConfiguration)' inputs: command: 'build' - arguments: '--no-restore --configuration Release' + arguments: '--no-restore --configuration $(buildConfiguration)' projects: '**/*.csproj' - task: DotNetCoreCLI@2 - displayName: 'Publish the project - Release' + displayName: 'Publish the project - $(buildConfiguration)' inputs: command: 'publish' projects: '**/*.csproj' publishWebProjects: false - arguments: '--no-build --configuration Release --output $(Build.ArtifactStagingDirectory)/Release' + arguments: '--no-build --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)/$(buildConfiguration)' zipAfterPublish: true - task: PublishBuildArtifacts@1 From b9cc518cf696f6d2568eb1ebc1e334490b4653f2 Mon Sep 17 00:00:00 2001 From: ztevens Date: Fri, 8 Aug 2025 14:54:34 +0100 Subject: [PATCH 09/10] replaced node-ass with sass --- azure-pipelines.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f15295c1f35..c6810792a82 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -21,8 +21,10 @@ steps: verbose: false # Replace node-sass with sass compilation -- script: './node_modules/.bin/node-sass $(wwwrootDir) --output $(wwwrootDir)' +- script: | + npx sass $(wwwrootDir):$(wwwrootDir) --no-source-map --style=compressed displayName: 'Compile Sass assets' + workingDirectory: $(System.DefaultWorkingDirectory) - task: gulp@1 displayName: 'Run gulp tasks' From 1b19d576daf271ed351aa07aab3ec2bdd72980a1 Mon Sep 17 00:00:00 2001 From: ztevens Date: Fri, 8 Aug 2025 16:22:45 +0100 Subject: [PATCH 10/10] adding templates for release and debug --- azure-pipelines.yml | 13 +++++++------ templates/build.yml | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 templates/build.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c6810792a82..898fd79beaf 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -39,12 +39,13 @@ steps: command: 'restore' projects: '**/*.csproj' -- task: DotNetCoreCLI@2 - displayName: 'Build the project - $(buildConfiguration)' - inputs: - command: 'build' - arguments: '--no-restore --configuration $(buildConfiguration)' - projects: '**/*.csproj' +- template: templates/build.yml + parameters: + buildConfiguration: 'Debug' + +- template: templates/build.yml + parameters: + buildConfiguration: 'Release' - task: DotNetCoreCLI@2 displayName: 'Publish the project - $(buildConfiguration)' diff --git a/templates/build.yml b/templates/build.yml new file mode 100644 index 00000000000..15ca39ca575 --- /dev/null +++ b/templates/build.yml @@ -0,0 +1,19 @@ +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 \ No newline at end of file