From 3c293b6aaf126949bb9ecbbec84973858c7cd772 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Fri, 24 Jan 2025 10:33:26 -0500 Subject: [PATCH 1/2] ci: upload gem from GitLab release stage --- .gitlab-ci.yml | 2 ++ .gitlab/release.yml | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 .gitlab/release.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 58294686337..0869081637c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,10 +6,12 @@ stages: - macrobenchmarks - microbenchmarks - benchmarks + - release include: - remote: https://gitlab-templates.ddbuild.io/libdatadog/include/one-pipeline.yml - local: ".gitlab/benchmarks.yml" + - local: ".gitlab/release.yml" variables: RUBY_CUSTOM_IMAGE_BASE: $DOCKER_REGISTRY/ci/dd-trace-rb/custom_ruby diff --git a/.gitlab/release.yml b/.gitlab/release.yml new file mode 100644 index 00000000000..22ba0c4d173 --- /dev/null +++ b/.gitlab/release.yml @@ -0,0 +1,19 @@ +release_ruby_gem: + stage: release + image: $DOCKER_REGISTRY/images/mirror/ruby:3.2.2 + tags: ["arch:amd64"] + only: + # v2.10.0 + # v2.10.1 + # v2.10.0rc0 + # v2.10.0rc5 + - /^v[0-9]+\.[0-9]+\.[0-9]+(rc[0-9]+)?$/ + before_script: + - | + curl -L "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.2.3.zip" -o "awscliv2.zip" + echo "13ee8a87756aa61027bd87985d4da4dee7ac777a36410321b03621a943cf030e awscliv2.zip" | sha256sum --check + unzip awscliv2.zip + ./aws/install + - export GEM_HOST_API_KEY=$(aws ssm get-parameter --region us-east-1 --name "ci.${CI_PROJECT_NAME}.rubygems_datadog_token" --with-decryption --query "Parameter.Value" --out text) + script: + - gem publish pkg/datadog-*.gem From 6a99285e30a63c463488ac87bd46c9d9c1fc2437 Mon Sep 17 00:00:00 2001 From: Brett Langdon Date: Fri, 24 Jan 2025 16:22:19 -0500 Subject: [PATCH 2/2] Update .gitlab/release.yml Co-authored-by: Marco Costa --- .gitlab/release.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitlab/release.yml b/.gitlab/release.yml index 22ba0c4d173..85bf0bcfed0 100644 --- a/.gitlab/release.yml +++ b/.gitlab/release.yml @@ -3,11 +3,9 @@ release_ruby_gem: image: $DOCKER_REGISTRY/images/mirror/ruby:3.2.2 tags: ["arch:amd64"] only: - # v2.10.0 - # v2.10.1 - # v2.10.0rc0 - # v2.10.0rc5 - - /^v[0-9]+\.[0-9]+\.[0-9]+(rc[0-9]+)?$/ + # Version pattern from Rubygems: https://github.com/rubygems/rubygems/blob/969f32050f0dc024c411fef7cbe25b1aaed16983/lib/rubygems/version.rb#L158 + # with a added `v` prefix. + - /^v[0-9]+(?>\.[0-9a-zA-Z]+)*(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$/ before_script: - | curl -L "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.2.3.zip" -o "awscliv2.zip"