From f328600398d0f704293d3bad2abb8ea706b09d5e Mon Sep 17 00:00:00 2001 From: Killian Delarue Date: Fri, 5 Dec 2025 14:24:30 +0100 Subject: [PATCH] CI, Releases: Introduce [dispatch-call.sh] script --- .../ci/pipelines/octez_beta_release_tag.yml | 4 +--- .../ci/pipelines/octez_major_release_tag.yml | 4 +--- .../ci/pipelines/octez_minor_release_tag.yml | 4 +--- ci/lib_tezos_ci_jobs/release_tag.ml | 9 +-------- scripts/releases/dispatch-call.sh | 20 +++++++++++++++++++ 5 files changed, 24 insertions(+), 17 deletions(-) create mode 100755 scripts/releases/dispatch-call.sh diff --git a/.gitlab/ci/pipelines/octez_beta_release_tag.yml b/.gitlab/ci/pipelines/octez_beta_release_tag.yml index 5da0b7d2df8c..2f96cdbb342f 100644 --- a/.gitlab/ci/pipelines/octez_beta_release_tag.yml +++ b/.gitlab/ci/pipelines/octez_beta_release_tag.yml @@ -1515,9 +1515,7 @@ dispatch-call: - . ./scripts/ci/datadog_send_job_info.sh - . ./scripts/ci/datadog_send_job_cache_info.sh 'before' script: - - 'curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer - ${TEZCAPITAL_GITHUB_TOKEN}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/tez-capital/tezos-macos-pipeline/actions/workflows/macos.yml/dispatches - -d ''{"ref":"main","inputs":{"version": "${CI_COMMIT_TAG}"}}''' + - ./scripts/releases/dispatch-call.sh - . ./scripts/ci/datadog_send_job_script_step_time.sh || true after_script: - . ./scripts/ci/datadog_send_job_cache_info.sh 'after' diff --git a/.gitlab/ci/pipelines/octez_major_release_tag.yml b/.gitlab/ci/pipelines/octez_major_release_tag.yml index b3982f089134..e9fdec684f44 100644 --- a/.gitlab/ci/pipelines/octez_major_release_tag.yml +++ b/.gitlab/ci/pipelines/octez_major_release_tag.yml @@ -1537,9 +1537,7 @@ dispatch-call: - . ./scripts/ci/datadog_send_job_info.sh - . ./scripts/ci/datadog_send_job_cache_info.sh 'before' script: - - 'curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer - ${TEZCAPITAL_GITHUB_TOKEN}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/tez-capital/tezos-macos-pipeline/actions/workflows/macos.yml/dispatches - -d ''{"ref":"main","inputs":{"version": "${CI_COMMIT_TAG}"}}''' + - ./scripts/releases/dispatch-call.sh - . ./scripts/ci/datadog_send_job_script_step_time.sh || true after_script: - . ./scripts/ci/datadog_send_job_cache_info.sh 'after' diff --git a/.gitlab/ci/pipelines/octez_minor_release_tag.yml b/.gitlab/ci/pipelines/octez_minor_release_tag.yml index a89fb3097cc8..d00aac8c4d1b 100644 --- a/.gitlab/ci/pipelines/octez_minor_release_tag.yml +++ b/.gitlab/ci/pipelines/octez_minor_release_tag.yml @@ -1066,9 +1066,7 @@ dispatch-call: - . ./scripts/ci/datadog_send_job_info.sh - . ./scripts/ci/datadog_send_job_cache_info.sh 'before' script: - - 'curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer - ${TEZCAPITAL_GITHUB_TOKEN}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/tez-capital/tezos-macos-pipeline/actions/workflows/macos.yml/dispatches - -d ''{"ref":"main","inputs":{"version": "${CI_COMMIT_TAG}"}}''' + - ./scripts/releases/dispatch-call.sh - . ./scripts/ci/datadog_send_job_script_step_time.sh || true after_script: - . ./scripts/ci/datadog_send_job_cache_info.sh 'after' diff --git a/ci/lib_tezos_ci_jobs/release_tag.ml b/ci/lib_tezos_ci_jobs/release_tag.ml index 79b6c1f4bd89..f814102a7d49 100644 --- a/ci/lib_tezos_ci_jobs/release_tag.ml +++ b/ci/lib_tezos_ci_jobs/release_tag.ml @@ -310,14 +310,7 @@ let octez_jobs ?(test = false) ?(major = true) release_tag_pipeline_type = ~name:"dispatch-call" ~dependencies: (Dependent [Job job_release_page; Job job_gitlab_release_or_publish]) - [ - "curl -L -X POST -H \"Accept: application/vnd.github+json\" -H \ - \"Authorization: Bearer ${TEZCAPITAL_GITHUB_TOKEN}\" -H \ - \"X-GitHub-Api-Version: 2022-11-28\" \ - https://api.github.com/repos/tez-capital/tezos-macos-pipeline/actions/workflows/macos.yml/dispatches \ - -d '{\"ref\":\"main\",\"inputs\":{\"version\": \ - \"${CI_COMMIT_TAG}\"}}'"; - ] + ["./scripts/releases/dispatch-call.sh"] in let job_trigger_monitoring = trigger_job diff --git a/scripts/releases/dispatch-call.sh b/scripts/releases/dispatch-call.sh new file mode 100755 index 000000000000..cfa61f2659ec --- /dev/null +++ b/scripts/releases/dispatch-call.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +set -e + +if [ -z "${TEZCAPITAL_GITHUB_TOKEN}" ]; then + echo "TEZCAPITAL_GITHUB_TOKEN is not set" + exit 1 +fi + +if [ -z "${CI_COMMIT_TAG}" ]; then + echo "CI_COMMIT_TAG is not set" + exit 1 +fi + +curl -L -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${TEZCAPITAL_GITHUB_TOKEN}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/tez-capital/tezos-macos-pipeline/actions/workflows/macos.yml/dispatches \ + -d "{\"ref\":\"main\",\"inputs\":{\"version\": \"${CI_COMMIT_TAG}\"}}" -- GitLab