From a327d03700e8cc94a14706d2368319d6fc7ea2f6 Mon Sep 17 00:00:00 2001 From: mahmoudsory <54558942+mahmoudsory@users.noreply.github.com> Date: Sun, 16 Mar 2025 14:37:37 +0200 Subject: [PATCH 1/9] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 23402e427df..555e726e83e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,3 +1,17 @@ -pool: MyAgentPool +# 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: +- main + +pool: + vmImage: ubuntu-latest + +variables: + buildConfiguration: 'Release' + steps: -- bash: echo hello world \ No newline at end of file +- script: dotnet build --configuration $(buildConfiguration) + displayName: 'dotnet build $(buildConfiguration)' From b7a16da1d7b377d80ce774dae3d4769d2e764706 Mon Sep 17 00:00:00 2001 From: mahmoudsory <54558942+mahmoudsory@users.noreply.github.com> Date: Tue, 18 Mar 2025 13:52:22 +0200 Subject: [PATCH 2/9] 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 555e726e83e..8ed39fddc69 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,7 +7,7 @@ trigger: - main pool: - vmImage: ubuntu-latest + my-personal-computer variables: buildConfiguration: 'Release' From 9353063902c1fbf5d094b94e44b309272df9b87a Mon Sep 17 00:00:00 2001 From: mahmoudsory Date: Tue, 18 Mar 2025 14:03:16 +0200 Subject: [PATCH 3/9] Add build tasks --- azure-pipelines.yml | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8ed39fddc69..51336360817 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,17 +1,44 @@ -# 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: -- main +- '*' pool: my-personal-computer + variables: buildConfiguration: 'Release' steps: -- script: dotnet build --configuration $(buildConfiguration) - displayName: 'dotnet build $(buildConfiguration)' +- 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 cf1b8c1b3e0a9322f2e452020b86f677890668e5 Mon Sep 17 00:00:00 2001 From: mahmoudsory <54558942+mahmoudsory@users.noreply.github.com> Date: Thu, 20 Mar 2025 12:40:50 +0200 Subject: [PATCH 4/9] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 51336360817..13ef19782e4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,7 +2,8 @@ trigger: - '*' pool: - my-personal-computer + Azure Pipelines + variables: From 5b54c502a4de06661b40f75f39ca42243cb0ae2b Mon Sep 17 00:00:00 2001 From: mahmoudsory Date: Thu, 20 Mar 2025 12:55:07 +0200 Subject: [PATCH 5/9] Add publish tasks --- azure-pipelines.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 13ef19782e4..ebe539871fd 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,18 +2,21 @@ trigger: - '*' pool: +<<<<<<< HEAD Azure Pipelines variables: buildConfiguration: 'Release' +======= + vmImage: ubuntu-latest +>>>>>>> 921df0b (Add publish tasks) steps: - task: UseDotNet@2 displayName: 'Use .NET SDK 6.x' inputs: - packageType: sdk version: '6.x' - task: Npm@1 @@ -42,4 +45,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 e433934037a9dc3bb010391ec06bf2332ea6217e Mon Sep 17 00:00:00 2001 From: mahmoudsory <54558942+mahmoudsory@users.noreply.github.com> Date: Thu, 20 Mar 2025 13:00:28 +0200 Subject: [PATCH 6/9] Update azure-pipelines.yml --- azure-pipelines.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ebe539871fd..5c44c957b6f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,16 +2,7 @@ trigger: - '*' pool: -<<<<<<< HEAD - Azure Pipelines - - - -variables: - buildConfiguration: 'Release' -======= vmImage: ubuntu-latest ->>>>>>> 921df0b (Add publish tasks) steps: - task: UseDotNet@2 @@ -58,4 +49,4 @@ steps: - task: PublishBuildArtifacts@1 displayName: 'Publish Artifact: drop' - condition: succeeded() \ No newline at end of file + condition: succeeded() From 36bf83fd9cf4fa37f291dd52fbc9e56cfa9d8fa5 Mon Sep 17 00:00:00 2001 From: mahmoudsory <54558942+mahmoudsory@users.noreply.github.com> Date: Thu, 20 Mar 2025 13:09:51 +0200 Subject: [PATCH 7/9] Refactor common variables --- azure-pipelines.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5c44c957b6f..878f189ef59 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,18 +4,23 @@ trigger: pool: vmImage: ubuntu-latest +variables: + buildConfiguration: 'Release' + wwwrootDir: 'Tailspin.SpaceGame.Web/wwwroot' + dotnetSdkVersion: '6.x' + steps: - task: UseDotNet@2 - displayName: 'Use .NET SDK 6.x' + displayName: 'Use .NET SDK $(dotnetSdkVersion)' inputs: - version: '6.x' + version: '$(dotnetSdkVersion)' - 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' +- script: './node_modules/.bin/node-sass $(wwwrootDir) --output $(wwwrootDir)' displayName: 'Compile Sass assets' - task: gulp@1 @@ -23,7 +28,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' @@ -32,19 +37,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 c2ef40a34861ac06a889e57eeb029472642f87c5 Mon Sep 17 00:00:00 2001 From: mahmoudsory Date: Thu, 20 Mar 2025 13:58:14 +0200 Subject: [PATCH 8/9] Support build configurations --- azure-pipelines.yml | 10 ++++++++++ templates/build.yml | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 templates/build.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 878f189ef59..a5ebe15a891 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -36,6 +36,7 @@ steps: command: 'restore' projects: '**/*.csproj' +<<<<<<< HEAD - task: DotNetCoreCLI@2 displayName: 'Build the project - $(buildConfiguration)' inputs: @@ -51,6 +52,15 @@ steps: publishWebProjects: false arguments: '--no-build --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)/$(buildConfiguration)' zipAfterPublish: true +======= +- template: templates/build.yml + parameters: + buildConfiguration: 'Debug' + +- template: templates/build.yml + parameters: + buildConfiguration: 'Release' +>>>>>>> 014408c (Support build configurations) - task: PublishBuildArtifacts@1 displayName: 'Publish Artifact: drop' 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 53a3468f8672b25802387630c695361b3d6ef18e Mon Sep 17 00:00:00 2001 From: mahmoudsory <54558942+mahmoudsory@users.noreply.github.com> Date: Thu, 20 Mar 2025 14:05:13 +0200 Subject: [PATCH 9/9] Support build configurations --- azure-pipelines.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a5ebe15a891..ba820863f96 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -36,23 +36,6 @@ steps: command: 'restore' projects: '**/*.csproj' -<<<<<<< HEAD -- task: DotNetCoreCLI@2 - displayName: 'Build the project - $(buildConfiguration)' - inputs: - command: 'build' - 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 -======= - template: templates/build.yml parameters: buildConfiguration: 'Debug' @@ -60,7 +43,6 @@ steps: - template: templates/build.yml parameters: buildConfiguration: 'Release' ->>>>>>> 014408c (Support build configurations) - task: PublishBuildArtifacts@1 displayName: 'Publish Artifact: drop'