fix: remove deploy github job from ci-build#2526
fix: remove deploy github job from ci-build#2526jingjingjia-ms wants to merge 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Removes the GitHub release deployment job from the CI build pipeline so that GitHub deployments are handled by the release process instead.
Changes:
- Deleted the
deploy_githubdeployment job from thedeploystage in the Azure Pipelines CI definition. - Left the Maven deployment (
deploy_maven) as the remaining deployment job in thedeploystage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - stage: deploy | ||
| condition: and(or(contains(variables['build.sourceBranch'], 'refs/tags/v'), eq(variables['build.sourceBranch'], '${{ parameters.previewBranch }}')), succeeded()) | ||
| dependsOn: build | ||
| jobs: | ||
| - deployment: deploy_github | ||
| condition: and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded()) | ||
| pool: | ||
| name: Azure-Pipelines-1ESPT-ExDShared | ||
| os: linux | ||
| image: ubuntu-latest | ||
| templateContext: | ||
| type: releaseJob | ||
| isProduction: true | ||
| inputs: | ||
| - input: pipelineArtifact | ||
| artifactName: jars | ||
| targetPath: "$(Pipeline.Workspace)" | ||
| environment: kiota-github-releases | ||
| strategy: | ||
| runOnce: | ||
| deploy: | ||
| steps: | ||
| - pwsh: | | ||
| $zips = Get-ChildItem -Path "$(Pipeline.Workspace)" -Filter "*.jar" | ||
| $zip = $zips | Select-Object -First 1 | ||
| $zipName = $zip.Name | ||
| if ($zipName -match "\d+.\d+.\d+") | ||
| { | ||
| $version = $matches[0] | ||
| echo "Current version is $version" | ||
| echo "##vso[task.setvariable variable=artifactVersion;]$version" | ||
| } | ||
| else | ||
| { | ||
| Write-Error "No valid version found in jar file name." | ||
| exit 1 | ||
| } | ||
|
|
||
| - task: GitHubRelease@1 | ||
| inputs: | ||
| gitHubConnection: "microsoftkiota" | ||
| tagSource: userSpecifiedTag | ||
| tag: "v$(artifactVersion)" | ||
| title: "v$(artifactVersion)" | ||
| assets: | | ||
| $(Pipeline.Workspace)/**/*.jar | ||
| $(Pipeline.Workspace)/**/*.jar.md5 | ||
| $(Pipeline.Workspace)/**/*.jar.sha1 | ||
| $(Pipeline.Workspace)/**/*.jar.sha256 | ||
| $(Pipeline.Workspace)/**/*.jar.sha512 | ||
| $(Pipeline.Workspace)/**/*.jar.asc | ||
| $(Pipeline.Workspace)/**/*.jar.asc.md5 | ||
| $(Pipeline.Workspace)/**/*.jar.asc.sha1 | ||
| $(Pipeline.Workspace)/**/*.jar.asc.sha256 | ||
| $(Pipeline.Workspace)/**/*.jar.asc.sha512 | ||
| $(Pipeline.Workspace)/**/*.pom | ||
| $(Pipeline.Workspace)/**/*.pom.md5 | ||
| $(Pipeline.Workspace)/**/*.pom.sha1 | ||
| $(Pipeline.Workspace)/**/*.pom.sha256 | ||
| $(Pipeline.Workspace)/**/*.pom.sha512 | ||
| $(Pipeline.Workspace)/**/*.pom.asc | ||
| $(Pipeline.Workspace)/**/*.pom.asc.md5 | ||
| $(Pipeline.Workspace)/**/*.pom.asc.sha1 | ||
| $(Pipeline.Workspace)/**/*.pom.asc.sha256 | ||
| $(Pipeline.Workspace)/**/*.pom.asc.sha512 | ||
| $(Pipeline.Workspace)/**/*.module | ||
| $(Pipeline.Workspace)/**/*.module.md5 | ||
| $(Pipeline.Workspace)/**/*.module.sha1 | ||
| $(Pipeline.Workspace)/**/*.module.sha256 | ||
| $(Pipeline.Workspace)/**/*.module.sha512 | ||
| $(Pipeline.Workspace)/**/*.module.asc | ||
| $(Pipeline.Workspace)/**/*.module.asc.md5 | ||
| $(Pipeline.Workspace)/**/*.module.asc.sha1 | ||
| $(Pipeline.Workspace)/**/*.module.asc.sha256 | ||
| $(Pipeline.Workspace)/**/*.module.asc.sha512 | ||
|
|
||
| addChangeLog: false | ||
| action: edit | ||
|
|
||
| - deployment: deploy_maven | ||
| # snapshots are not supported by ESRP release for now, but they are planning to add support. When it happens, simply remove the condition | ||
| condition: and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded()) |
There was a problem hiding this comment.
The deploy stage still has a condition that allows it to run on previewBranch, but after removing deploy_github the only remaining job (deploy_maven) runs only for tags (refs/tags/v). This makes the deploy stage execute and then immediately skip all jobs on previewBranch, which is confusing and leaves previewBranch seemingly unnecessary. Consider updating the stage condition to match the remaining job(s), and if previewBranch is no longer needed, remove the parameter as well.
Deploy github job is taken care of by release please.