diff --git a/.azure/build-pipeline.yaml b/.azure/build-pipeline.yaml index 3598d55..9b2e55c 100644 --- a/.azure/build-pipeline.yaml +++ b/.azure/build-pipeline.yaml @@ -63,7 +63,8 @@ stages: displayName: Deploy Java dependsOn: - run_systemtests - condition: and(succeeded(), or(eq(variables['build.sourceBranch'], 'refs/heads/main'), startsWith(variables['build.sourceBranch'], 'refs/heads/release-'))) + # Deploy Strimzi Java artifacts -> run only on main branch (where it pushes snapshots to Maven Central repo) + condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/main')) jobs: - template: 'templates/jobs/deploy_java.yaml' parameters: diff --git a/.azure/release-pipeline.yaml b/.azure/release-pipeline.yaml index f1c9293..fecbd96 100644 --- a/.azure/release-pipeline.yaml +++ b/.azure/release-pipeline.yaml @@ -32,11 +32,6 @@ stages: jobs: - job: 'release_artifacts' displayName: 'Release Artifacts' - strategy: - matrix: - 'java-17': - image: 'Ubuntu-22.04' - jdk_version: '17' # Set timeout for jobs timeoutInMinutes: 60 # Base system @@ -45,8 +40,6 @@ stages: # Pipeline steps steps: - template: 'templates/steps/prerequisites/install_java.yaml' - parameters: - JDK_VERSION: $(jdk_version) - template: "templates/steps/prerequisites/install_helm.yaml" - bash: ".azure/scripts/release-artifacts.sh" env: @@ -55,6 +48,16 @@ stages: RELEASE_VERSION: '${{ parameters.releaseVersion }}' MVN_ARGS: '-B' displayName: "Prepare release artifacts" + # Deploy Java artifacts + - bash: "./.azure/scripts/push-to-central.sh" + env: + MVN_ARGS: "-e -V -B" + BUILD_REASON: $(Build.Reason) + BRANCH: $(Build.SourceBranch) + GPG_PASSPHRASE: $(GPG_PASSPHRASE) + GPG_SIGNING_KEY: $(GPG_SIGNING_KEY) + CENTRAL_USERNAME: $(CENTRAL_USERNAME) + CENTRAL_PASSWORD: $(CENTRAL_PASSWORD) - publish: $(System.DefaultWorkingDirectory)/strimzi-access-operator-${{ parameters.releaseVersion }}.tar.gz artifact: ReleaseTarGzArchive - publish: $(System.DefaultWorkingDirectory)/strimzi-access-operator-${{ parameters.releaseVersion }}.zip diff --git a/.azure/templates/steps/prerequisites/install_java.yaml b/.azure/templates/steps/prerequisites/install_java.yaml index ca43101..140b240 100644 --- a/.azure/templates/steps/prerequisites/install_java.yaml +++ b/.azure/templates/steps/prerequisites/install_java.yaml @@ -5,7 +5,7 @@ parameters: steps: - task: JavaToolInstaller@0 inputs: - versionSpec: $(JDK_VERSION) + versionSpec: ${{ parameters.JDK_VERSION }} jdkArchitectureOption: 'x64' jdkSourceOption: 'PreInstalled' displayName: 'Configure Java'