From 55509bdbbc81372a621cd6c0272f2995b8b2013b Mon Sep 17 00:00:00 2001 From: darsAcn Date: Mon, 27 Oct 2025 09:27:18 +0800 Subject: [PATCH 01/12] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 23402e427df..50033eb2a2e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,3 +1,38 @@ -pool: MyAgentPool +trigger: +- main + +pool: + vmImage: 'windows-latest' + +variables: + buildConfiguration: 'Release' + steps: -- bash: echo hello world \ No newline at end of file +- task: UseDotNet@2 + inputs: + packageType: 'sdk' + version: '8.x' + installationPath: $(Agent.ToolsDirectory)/dotnet + +- task: DotNetCoreCLI@2 + inputs: + command: 'restore' + projects: '**/*.csproj' + +- task: DotNetCoreCLI@2 + inputs: + command: 'build' + projects: '**/*.csproj' + arguments: '--configuration $(buildConfiguration)' + +- task: DotNetCoreCLI@2 + inputs: + command: 'publish' + publishWebProjects: true + arguments: '--configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)' + zipAfterPublish: true + +- task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)' + ArtifactName: 'drop' From 7d4b61175cd2b16a5418d655fbfc2c24f3f60c33 Mon Sep 17 00:00:00 2001 From: darsAcn Date: Mon, 27 Oct 2025 09:29:32 +0800 Subject: [PATCH 02/12] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 50033eb2a2e..f1dbd2f7fed 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,7 +2,7 @@ trigger: - main pool: - vmImage: 'windows-latest' + vmImage: 'ubuntu-latest' variables: buildConfiguration: 'Release' From d1dc21b293e01ae542ce58b3647990691d3ad337 Mon Sep 17 00:00:00 2001 From: Dars Acn Date: Mon, 27 Oct 2025 09:36:17 +0800 Subject: [PATCH 03/12] Add build tasks --- azure-pipelines.yml | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f1dbd2f7fed..65a34fb012a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,38 +1,43 @@ trigger: -- main +- '*' pool: - vmImage: 'ubuntu-latest' + vmImage: ubuntu-latest variables: buildConfiguration: 'Release' steps: - task: UseDotNet@2 + displayName: 'Use .NET SDK 6.x' inputs: - packageType: 'sdk' - version: '8.x' - installationPath: $(Agent.ToolsDirectory)/dotnet + packageType: sdk + version: '6.x' -- task: DotNetCoreCLI@2 +- task: Npm@1 + displayName: 'Run npm install' inputs: - command: 'restore' - projects: '**/*.csproj' + 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: 'build' + command: 'restore' projects: '**/*.csproj' - arguments: '--configuration $(buildConfiguration)' - task: DotNetCoreCLI@2 + displayName: 'Build the project - Release' inputs: - command: 'publish' - publishWebProjects: true - arguments: '--configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)' - zipAfterPublish: true - -- task: PublishBuildArtifacts@1 - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)' - ArtifactName: 'drop' + command: 'build' + arguments: '--no-restore --configuration Release' + projects: '**/*.csproj' \ No newline at end of file From d2b31aaa511abc9df23b7fe7aa1e98a534478320 Mon Sep 17 00:00:00 2001 From: Dars Acn Date: Mon, 27 Oct 2025 11:02:23 +0800 Subject: [PATCH 04/12] Add build tasks --- azure-pipelines.yml | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 65a34fb012a..22c617bbc20 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -8,36 +8,49 @@ variables: buildConfiguration: 'Release' steps: -- task: UseDotNet@2 - displayName: 'Use .NET SDK 6.x' +# ✅ Use Node 18 LTS instead of default Node 20 +- task: UseNode@1 + displayName: 'Use Node.js 18 LTS' inputs: - packageType: sdk - version: '6.x' + version: '18.x' -- task: Npm@1 - displayName: 'Run npm install' - inputs: - verbose: false +# ✅ Install dependencies safely (avoid node-gyp conflicts) +- script: | + npm cache clean --force + npm install --legacy-peer-deps + displayName: 'Install npm dependencies' +# ✅ Compile Sass assets - 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' +# ✅ Run Gulp tasks +- task: Gulp@1 + displayName: 'Run Gulp tasks' +# ✅ Record build info - script: 'echo "$(Build.DefinitionName), $(Build.BuildId), $(Build.BuildNumber)" > buildinfo.txt' displayName: 'Write build info' workingDirectory: Tailspin.SpaceGame.Web/wwwroot +# ✅ .NET SDK setup +- task: UseDotNet@2 + displayName: 'Use .NET SDK 6.x' + inputs: + packageType: sdk + version: '6.x' + +# ✅ Restore .NET project dependencies - task: DotNetCoreCLI@2 displayName: 'Restore project dependencies' inputs: command: 'restore' projects: '**/*.csproj' +# ✅ Build the .NET project - task: DotNetCoreCLI@2 displayName: 'Build the project - Release' inputs: command: 'build' arguments: '--no-restore --configuration Release' - projects: '**/*.csproj' \ No newline at end of file + projects: '**/*.csproj' From cb406c12e9ba0b53d347e9d4d61be1b3775df63e Mon Sep 17 00:00:00 2001 From: Dars Acn Date: Mon, 27 Oct 2025 11:07:42 +0800 Subject: [PATCH 05/12] Add build Tasks 2 --- azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 22c617bbc20..1a5e0904a9a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -35,11 +35,11 @@ steps: # ✅ .NET SDK setup - task: UseDotNet@2 - displayName: 'Use .NET SDK 6.x' + displayName: 'Use .NET SDK 8.x' inputs: packageType: sdk - version: '6.x' - + version: '8.x' + # ✅ Restore .NET project dependencies - task: DotNetCoreCLI@2 displayName: 'Restore project dependencies' From d37a8f48a890fc4c6cc69e5a598c756c2ec927b6 Mon Sep 17 00:00:00 2001 From: Dars Acn Date: Mon, 27 Oct 2025 11:48:14 +0800 Subject: [PATCH 06/12] Refactor common variables --- azure-pipelines.yml | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1a5e0904a9a..cdaad1cf1bd 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,6 +6,8 @@ pool: variables: buildConfiguration: 'Release' + wwwrootDir: 'Tailspin.SpaceGame.Web/wwwroot' + dotnetSdkVersion: '8.x' steps: # ✅ Use Node 18 LTS instead of default Node 20 @@ -21,7 +23,7 @@ steps: displayName: 'Install npm dependencies' # ✅ Compile Sass assets -- script: './node_modules/.bin/node-sass Tailspin.SpaceGame.Web/wwwroot --output Tailspin.SpaceGame.Web/wwwroot' +- script: './node_modules/.bin/node-sass $(wwwrootDir) --output $(wwwrootDir) displayName: 'Compile Sass assets' # ✅ Run Gulp tasks @@ -31,15 +33,15 @@ steps: # ✅ Record build info - script: 'echo "$(Build.DefinitionName), $(Build.BuildId), $(Build.BuildNumber)" > buildinfo.txt' displayName: 'Write build info' - workingDirectory: Tailspin.SpaceGame.Web/wwwroot + workingDirectory: $(wwwrootDir) # ✅ .NET SDK setup - task: UseDotNet@2 - displayName: 'Use .NET SDK 8.x' + displayName: 'Use .NET SDK $(dotnetSdkVersion)' inputs: packageType: sdk - version: '8.x' - + version: '$(dotnetSdkVersion)' + # ✅ Restore .NET project dependencies - task: DotNetCoreCLI@2 displayName: 'Restore project dependencies' @@ -49,8 +51,21 @@ steps: # ✅ Build the .NET project - 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 - $(buildConfiguration)' + inputs: + command: 'publish' projects: '**/*.csproj' + publishWebProjects: false + arguments: '--no-build --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)/$(buildConfiguration)'' + zipAfterPublish: true + +- task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: drop' + condition: succeeded() \ No newline at end of file From a5710e63745cfb9ca16e9bcfc07559ca1a1a0c14 Mon Sep 17 00:00:00 2001 From: Dars Acn Date: Mon, 27 Oct 2025 11:51:23 +0800 Subject: [PATCH 07/12] Refactor common variables --- azure-pipelines.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cdaad1cf1bd..ea49c70b12b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,20 +10,21 @@ variables: dotnetSdkVersion: '8.x' steps: -# ✅ Use Node 18 LTS instead of default Node 20 +# ✅ Use Node 18 LTS - task: UseNode@1 displayName: 'Use Node.js 18 LTS' inputs: version: '18.x' -# ✅ Install dependencies safely (avoid node-gyp conflicts) +# ✅ Install dependencies safely - script: | npm cache clean --force npm install --legacy-peer-deps displayName: 'Install npm dependencies' # ✅ Compile Sass assets -- script: './node_modules/.bin/node-sass $(wwwrootDir) --output $(wwwrootDir) +- script: | + ./node_modules/.bin/node-sass $(wwwrootDir) --output $(wwwrootDir) displayName: 'Compile Sass assets' # ✅ Run Gulp tasks @@ -57,15 +58,17 @@ steps: arguments: '--no-restore --configuration $(buildConfiguration)' projects: '**/*.csproj' +# ✅ Publish the .NET project - task: DotNetCoreCLI@2 displayName: 'Publish the project - $(buildConfiguration)' inputs: command: 'publish' projects: '**/*.csproj' publishWebProjects: false - arguments: '--no-build --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)/$(buildConfiguration)'' + arguments: '--no-build --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)/$(buildConfiguration)' zipAfterPublish: true +# ✅ Publish artifacts - task: PublishBuildArtifacts@1 displayName: 'Publish Artifact: drop' - condition: succeeded() \ No newline at end of file + condition: succeeded() From 3c3f1e1172fe35c16608cf5dc0daa72314d8599f Mon Sep 17 00:00:00 2001 From: Dars Acn Date: Mon, 27 Oct 2025 12:30:26 +0800 Subject: [PATCH 08/12] Support build configurations --- azure-pipelines.yml | 8 ++++++++ templates/build.yml | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 templates/build.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ea49c70b12b..0e334e5a2b4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -58,6 +58,14 @@ steps: arguments: '--no-restore --configuration $(buildConfiguration)' projects: '**/*.csproj' +- template: templates/build.yml + parameters: + buildConfiguration: 'Debug' + +- template: templates/build.yml + parameters: + buildConfiguration: 'Release' + # ✅ Publish the .NET project - 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 From 9d715158df2d6e8e16d9b4655ef809bc57cc9906 Mon Sep 17 00:00:00 2001 From: Dars Acn Date: Mon, 27 Oct 2025 14:04:53 +0800 Subject: [PATCH 09/12] Improve the text at the top of the home page --- Tailspin.SpaceGame.Web/Views/Home/Index.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tailspin.SpaceGame.Web/Views/Home/Index.cshtml b/Tailspin.SpaceGame.Web/Views/Home/Index.cshtml index f7c4c886074..16197a5d169 100644 --- a/Tailspin.SpaceGame.Web/Views/Home/Index.cshtml +++ b/Tailspin.SpaceGame.Web/Views/Home/Index.cshtml @@ -5,7 +5,7 @@
Space Game -

An example site for learning

+

Welcome to the oficial Space Game site!

From 3b6e05e40357a5a3ff54ff6e40462d7e2183bd27 Mon Sep 17 00:00:00 2001 From: darsAcn Date: Mon, 27 Oct 2025 14:31:28 +0800 Subject: [PATCH 10/12] Add build badge --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ece99adf323..7a2662c0903 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ - +[![Build Status](https://dev.azure.com/appdev-upskilling-fy26/daryl.b.sardon/_apis/build/status%2FdarsAcn.mslearn-tailspin-spacegame-web?branchName=main)](https://dev.azure.com/appdev-upskilling-fy26/daryl.b.sardon/_build/latest?definitionId=84&branchName=main) # Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a @@ -63,3 +63,4 @@ Privacy information can be found at https://privacy.microsoft.com/en-us/ Microsoft and any contributors reserve all other rights, whether under their respective copyrights, patents, or trademarks, whether by implication, estoppel or otherwise. + From c7e45e2f2c4d7756c8252dce8fec8bf9b261f9f7 Mon Sep 17 00:00:00 2001 From: Dars Acn Date: Mon, 27 Oct 2025 14:41:33 +0800 Subject: [PATCH 11/12] git remote -v --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ece99adf323..7a2662c0903 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ - +[![Build Status](https://dev.azure.com/appdev-upskilling-fy26/daryl.b.sardon/_apis/build/status%2FdarsAcn.mslearn-tailspin-spacegame-web?branchName=main)](https://dev.azure.com/appdev-upskilling-fy26/daryl.b.sardon/_build/latest?definitionId=84&branchName=main) # Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a @@ -63,3 +63,4 @@ Privacy information can be found at https://privacy.microsoft.com/en-us/ Microsoft and any contributors reserve all other rights, whether under their respective copyrights, patents, or trademarks, whether by implication, estoppel or otherwise. + From 74b675b15e0ed48bebb7b40ef5a738dae433895a Mon Sep 17 00:00:00 2001 From: Dars Acn Date: Mon, 27 Oct 2025 14:42:49 +0800 Subject: [PATCH 12/12] Fix typing error on the home page --- Tailspin.SpaceGame.Web/Views/Home/Index.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tailspin.SpaceGame.Web/Views/Home/Index.cshtml b/Tailspin.SpaceGame.Web/Views/Home/Index.cshtml index 16197a5d169..79b4cb2750c 100644 --- a/Tailspin.SpaceGame.Web/Views/Home/Index.cshtml +++ b/Tailspin.SpaceGame.Web/Views/Home/Index.cshtml @@ -5,7 +5,7 @@
Space Game -

Welcome to the oficial Space Game site!

+

Welcome to the official Space Game site!