From 750ce207e50113fb12834542c42120e9dd69f290 Mon Sep 17 00:00:00 2001 From: Krzysztof Klimonda Date: Fri, 28 Oct 2022 13:19:07 +0200 Subject: [PATCH] Move java SDK release job to a workload triggered on semver tags (#812) We can't have multiple workloads triggered by the same commit/tag, and moving java release job under release-components workload would trigger java sdk release multiple times. Instead, move it to our workload triggered by a semver tag (tag created when we are doing github release) so that it's triggered once per release. --- .circleci/config.yml | 39 ------------------------------------- .circleci/post-release.yaml | 34 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 39 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 62fe916a35..d895405585 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -87,31 +87,6 @@ commands: asdf reshim jobs: - publish-aperture-java-release: - parameters: - path: - type: string - description: Path to aperture-java - default: sdks/aperture-java - docker: - - image: cimg/openjdk:11.0 - steps: - - checkout - - restore_cache: - keys: - - gradle-v1-{{ checksum <>/"build.gradle.kts" }} - - gradle-v1- - # See https://discuss.circleci.com/t/gpg-keys-as-environment-variables/28641 - - run: - name: Publish to Sonatype - command: | - cd <> - GPG_PRIVATE_KEY=$(echo -e ${GPG_PRIVATE_KEY}) gradle assemble publishToSonatype - - save_cache: - paths: - - ~/.gradle - key: gradle-v1-{{ checksum <>/"build.gradle.kts" }} - release-components: executor: base-cimg-executor steps: @@ -301,17 +276,3 @@ workflows: tags: only: /^v.*$/ configuration_path: .circleci/post-release.yaml - - publish-aperture-java-release: - when: - matches: { value: << pipeline.git.tag >>, pattern: "^releases/.*$" } - jobs: - - publish-aperture-java-release: - path: sdks/aperture-java - context: sonatype - # both this and workflow's when is needed - filters: - branches: - ignore: /.+/ - tags: - only: /^releases\/.*$/ diff --git a/.circleci/post-release.yaml b/.circleci/post-release.yaml index 5aab334675..3b176544f0 100644 --- a/.circleci/post-release.yaml +++ b/.circleci/post-release.yaml @@ -34,6 +34,31 @@ jobs: tools: *tools_list cache_name: release-protobuf + publish-aperture-java-release: + parameters: + path: + type: string + description: Path to aperture-java + default: sdks/aperture-java + docker: + - image: cimg/openjdk:11.0 + steps: + - checkout + - restore_cache: + keys: + - gradle-v1-{{ checksum <>/"build.gradle.kts" }} + - gradle-v1- + # See https://discuss.circleci.com/t/gpg-keys-as-environment-variables/28641 + - run: + name: Publish to Sonatype + command: | + cd <> + GPG_PRIVATE_KEY=$(echo -e ${GPG_PRIVATE_KEY}) gradle assemble publishToSonatype + - save_cache: + paths: + - ~/.gradle + key: gradle-v1-{{ checksum <>/"build.gradle.kts" }} + tag-github-repository: executor: base-cimg-executor parameters: @@ -93,6 +118,15 @@ workflows: only: /^v.*/ tag: << pipeline.git.tag >> + - publish-aperture-java-release: + path: sdks/aperture-java + context: sonatype + # both this and workflow's when is needed + filters: + branches: + ignore: /.+/ + tags: + only: /^v.*$/ commands: asdf_install: