From 5d2a5bbcc91fb5b7880c72a9e4cbc211748ade35 Mon Sep 17 00:00:00 2001 From: ikolomi <152477505+ikolomi@users.noreply.github.com> Date: Tue, 11 Feb 2025 10:44:21 +0200 Subject: [PATCH 1/2] Merge pull request #3122 from valkey-io/ephemeral_label Avoid using ephemeral runners in publishing workflows since ephemeral runners are new feature and using them during the release can complicate the process. --- .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: From 89226c20708c9a1380eb5122621f4e5bd9112de4 Mon Sep 17 00:00:00 2001 From: Yury-Fridlyand Date: Tue, 11 Feb 2025 10:55:33 -0800 Subject: [PATCH 2/2] lint Signed-off-by: Yury-Fridlyand --- .github/workflows/go-cd.yml | 8 ++++---- .github/workflows/java-cd.yml | 8 ++++---- .github/workflows/npm-cd.yml | 8 ++++---- .github/workflows/pypi-cd.yml | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/go-cd.yml b/.github/workflows/go-cd.yml index 91ee1e1035..d18e35eb10 100644 --- a/.github/workflows/go-cd.yml +++ b/.github/workflows/go-cd.yml @@ -34,11 +34,11 @@ jobs: run: | # 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"]))) + select(.PACKAGE_MANAGERS != null and (.PACKAGE_MANAGERS | contains(["pkg_go_dev"]))) | .RUNNER = ( - if (.RUNNER | type == "array") - then (.RUNNER | map(select(. != "ephemeral"))) - else .RUNNER + if (.RUNNER | type == "array") + then (.RUNNER | map(select(. != "ephemeral"))) + else .RUNNER end ) )' < .github/json_matrices/build-matrix.json | jq -c .) diff --git a/.github/workflows/java-cd.yml b/.github/workflows/java-cd.yml index 5c6e98a156..d5398eea6f 100644 --- a/.github/workflows/java-cd.yml +++ b/.github/workflows/java-cd.yml @@ -37,11 +37,11 @@ jobs: run: | # 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"]))) + select(.PACKAGE_MANAGERS != null and (.PACKAGE_MANAGERS | contains(["maven"]))) | .RUNNER = ( - if (.RUNNER | type == "array") - then (.RUNNER | map(select(. != "ephemeral"))) - else .RUNNER + if (.RUNNER | type == "array") + then (.RUNNER | map(select(. != "ephemeral"))) + else .RUNNER end ) )' < .github/json_matrices/build-matrix.json | jq -c .) diff --git a/.github/workflows/npm-cd.yml b/.github/workflows/npm-cd.yml index b9439a9012..84e0d84d2b 100644 --- a/.github/workflows/npm-cd.yml +++ b/.github/workflows/npm-cd.yml @@ -61,11 +61,11 @@ jobs: run: | # 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"]))) + select(.PACKAGE_MANAGERS != null and (.PACKAGE_MANAGERS | contains(["npm"]))) | .RUNNER = ( - if (.RUNNER | type == "array") - then (.RUNNER | map(select(. != "ephemeral"))) - else .RUNNER + if (.RUNNER | type == "array") + then (.RUNNER | map(select(. != "ephemeral"))) + else .RUNNER end ) )' < .github/json_matrices/build-matrix.json | jq -c .) diff --git a/.github/workflows/pypi-cd.yml b/.github/workflows/pypi-cd.yml index 8caf9d03e2..d951a9a1ea 100644 --- a/.github/workflows/pypi-cd.yml +++ b/.github/workflows/pypi-cd.yml @@ -43,11 +43,11 @@ jobs: run: | # 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"]))) + select(.PACKAGE_MANAGERS != null and (.PACKAGE_MANAGERS | contains(["pypi"]))) | .RUNNER = ( - if (.RUNNER | type == "array") - then (.RUNNER | map(select(. != "ephemeral"))) - else .RUNNER + if (.RUNNER | type == "array") + then (.RUNNER | map(select(. != "ephemeral"))) + else .RUNNER end ) )' < .github/json_matrices/build-matrix.json | jq -c .)