diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b01f84ee14b..31aaaea83ab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -184,7 +184,8 @@ deploy_to_sonatype: rules: - if: '$CI_COMMIT_BRANCH == "master"' when: on_success - - if: '$CI_COMMIT_TAG =~ /^v.*/' + # Do not deploy release candidate versions + - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' when: on_success - when: manual allow_failure: true @@ -205,6 +206,12 @@ deploy_artifacts_to_github: when: on_success - when: manual allow_failure: true + # Requires the deploy_to_sonatype job to have run first as build cache is broken + # This will deploy the artifacts built from the publishToSonatype task to the GitHub release + needs: + - job: deploy_to_sonatype + # The deploy_to_sonatype job is not run for release candidate versions + optional: true script: - aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.gh_release_token --with-decryption --query "Parameter.Value" --out text > github-token.txt - gh auth login --with-token < github-token.txt @@ -221,7 +228,7 @@ generate-lib-init-tag-values: rules: - if: '$POPULATE_CACHE' when: never - # We don't tag prerelease versions + # Do not tag release candidate versions - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' when: on_success - when: manual