From 6a3c0460c7693d4203d7e2c3d4c1e66ee0e1be4a 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 58da7e4af59d..fd9211b1126c 100644 --- a/.gitlab/ci/pipelines/octez_beta_release_tag.yml +++ b/.gitlab/ci/pipelines/octez_beta_release_tag.yml @@ -1503,9 +1503,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 48618ad56d7e..f804c7c06dbd 100644 --- a/.gitlab/ci/pipelines/octez_major_release_tag.yml +++ b/.gitlab/ci/pipelines/octez_major_release_tag.yml @@ -1525,9 +1525,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 310e0fc5f81a..559de07b0b51 100644 --- a/.gitlab/ci/pipelines/octez_minor_release_tag.yml +++ b/.gitlab/ci/pipelines/octez_minor_release_tag.yml @@ -1054,9 +1054,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