From 8518254c47ccd88114eff52c8ed8d1c900aafe6f Mon Sep 17 00:00:00 2001 From: ikolomi Date: Mon, 10 Feb 2025 23:39:45 +0200 Subject: [PATCH] Avoid using ephemeral runners in publishing workflows since ephemeral runners are new feature and using them during the release can complicate the process. Signed-off-by: ikolomi --- .github/workflows/go-cd.yml | 12 ++++++++++-- .github/workflows/java-cd.yml | 12 ++++++++++-- .github/workflows/npm-cd.yml | 12 ++++++++++-- .github/workflows/pypi-cd.yml | 12 ++++++++++-- 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/.github/workflows/go-cd.yml b/.github/workflows/go-cd.yml index 942dcf7dbd..91ee1e1035 100644 --- a/.github/workflows/go-cd.yml +++ b/.github/workflows/go-cd.yml @@ -32,8 +32,16 @@ jobs: id: load-platform-matrix shell: bash run: | - # Get the matrix from the matrix.json file, without the object that has the IMAGE key - export "PLATFORM_MATRIX=$(jq 'map(select(.PACKAGE_MANAGERS | contains(["pkg_go_dev"])))' < .github/json_matrices/build-matrix.json | jq -c .)" + # Filter entries with pkg_go_dev in PACKAGE_MANAGERS and remove "ephemeral" from RUNNER + export PLATFORM_MATRIX=$(jq 'map( + select(.PACKAGE_MANAGERS != null and (.PACKAGE_MANAGERS | contains(["pkg_go_dev"]))) + | .RUNNER = ( + if (.RUNNER | type == "array") + then (.RUNNER | map(select(. != "ephemeral"))) + else .RUNNER + end + ) + )' < .github/json_matrices/build-matrix.json | jq -c .) echo "PLATFORM_MATRIX=${PLATFORM_MATRIX}" >> $GITHUB_OUTPUT validate-release-version: diff --git a/.github/workflows/java-cd.yml b/.github/workflows/java-cd.yml index ed618f1708..5c6e98a156 100644 --- a/.github/workflows/java-cd.yml +++ b/.github/workflows/java-cd.yml @@ -35,8 +35,16 @@ jobs: id: load-platform-matrix shell: bash run: | - # Get the matrix from the matrix.json file, without the object that has the IMAGE key - export "PLATFORM_MATRIX=$(jq 'map(select(.PACKAGE_MANAGERS | contains(["maven"])))' < .github/json_matrices/build-matrix.json | jq -c .)" + # Filter entries with maven in PACKAGE_MANAGERS and remove "ephemeral" from RUNNER + export PLATFORM_MATRIX=$(jq 'map( + select(.PACKAGE_MANAGERS != null and (.PACKAGE_MANAGERS | contains(["maven"]))) + | .RUNNER = ( + if (.RUNNER | type == "array") + then (.RUNNER | map(select(. != "ephemeral"))) + else .RUNNER + end + ) + )' < .github/json_matrices/build-matrix.json | jq -c .) echo "PLATFORM_MATRIX=${PLATFORM_MATRIX}" >> $GITHUB_OUTPUT set-release-version: diff --git a/.github/workflows/npm-cd.yml b/.github/workflows/npm-cd.yml index 3e5f673a4c..b9439a9012 100644 --- a/.github/workflows/npm-cd.yml +++ b/.github/workflows/npm-cd.yml @@ -59,8 +59,16 @@ jobs: id: load-platform-matrix shell: bash run: | - # Get the matrix from the matrix.json file, without the object that has the IMAGE key - export "PLATFORM_MATRIX=$(jq 'map(select(.PACKAGE_MANAGERS != null and (.PACKAGE_MANAGERS | contains(["npm"]))))' < .github/json_matrices/build-matrix.json | jq -c .)" + # Filter entries with npm in PACKAGE_MANAGERS and remove "ephemeral" from RUNNER + export PLATFORM_MATRIX=$(jq 'map( + select(.PACKAGE_MANAGERS != null and (.PACKAGE_MANAGERS | contains(["npm"]))) + | .RUNNER = ( + if (.RUNNER | type == "array") + then (.RUNNER | map(select(. != "ephemeral"))) + else .RUNNER + end + ) + )' < .github/json_matrices/build-matrix.json | jq -c .) echo "PLATFORM_MATRIX=${PLATFORM_MATRIX}" >> $GITHUB_OUTPUT publish-binaries: diff --git a/.github/workflows/pypi-cd.yml b/.github/workflows/pypi-cd.yml index 1be3527e4a..8caf9d03e2 100644 --- a/.github/workflows/pypi-cd.yml +++ b/.github/workflows/pypi-cd.yml @@ -41,8 +41,16 @@ jobs: id: load-platform-matrix shell: bash run: | - # Get the matrix from the matrix.json file, without the object that has the IMAGE key - export "PLATFORM_MATRIX=$(jq 'map(select(.PACKAGE_MANAGERS != null and (.PACKAGE_MANAGERS | contains(["pypi"]))))' < .github/json_matrices/build-matrix.json | jq -c .)" + # Filter entries with pypi in PACKAGE_MANAGERS and remove "ephemeral" from RUNNER + export PLATFORM_MATRIX=$(jq 'map( + select(.PACKAGE_MANAGERS != null and (.PACKAGE_MANAGERS | contains(["pypi"]))) + | .RUNNER = ( + if (.RUNNER | type == "array") + then (.RUNNER | map(select(. != "ephemeral"))) + else .RUNNER + end + ) + )' < .github/json_matrices/build-matrix.json | jq -c .) echo "PLATFORM_MATRIX=${PLATFORM_MATRIX}" >> $GITHUB_OUTPUT start-self-hosted-runner: