From 4cbe089cb4813ccc353bab1ca022e1009229f9ce Mon Sep 17 00:00:00 2001 From: Jakub Domeracki Date: Mon, 11 Aug 2025 12:03:47 +0200 Subject: [PATCH 1/4] fix: upload the slim binaries from the build directory to the GCS bucket --- .github/workflows/release.yaml | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 23e1dfd6d2dab..bdc1e754f8172 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -641,7 +641,19 @@ jobs: version="$(./scripts/version.sh)" - binaries=( + # Source array of slim binaries + slim_binaries=( + "coder-slim_${version}_darwin_amd64" + "coder-slim_${version}_darwin_arm64" + "coder-slim_${version}_linux_amd64" + "coder-slim_${version}_linux_arm64" + "coder-slim_${version}_linux_armv7" + "coder-slim_${version}_windows_amd64.exe" + "coder-slim_${version}_windows_arm64.exe" + ) + + # Target array of CLI binary names + cli_binaries=( "coder-darwin-amd64" "coder-darwin-arm64" "coder-linux-amd64" @@ -651,10 +663,22 @@ jobs: "coder-windows-arm64.exe" ) - for binary in "${binaries[@]}"; do - detached_signature="${binary}.asc" - gcloud storage cp "./site/out/bin/${binary}" "gs://releases.coder.com/coder-cli/${version}/${binary}" - gcloud storage cp "./site/out/bin/${detached_signature}" "gs://releases.coder.com/coder-cli/${version}/${detached_signature}" + # Map slim binaries from the filesystem to the resulting cli binary names in the GCS bucket + for ((i=0; i<${#slim_binaries[@]}; i++)); do + # Get the slim and cli binary names using the current index + slim_binary="${slim_binaries[$i]}" + cli_binary="${cli_binaries[$i]}" + + # The detached signature file name remains the same as the slim binary name + detached_signature="${slim_binary}.asc" + + echo "Copying ${slim_binary} to ${cli_binary}..." + # Copy the main binary, renaming it in the process + gcloud storage cp "./build/${slim_binary}" "gs://releases.coder.com/coder-cli/${version}/${cli_binary}" + + echo "Copying ${detached_signature}..." + # Copy the signature file without renaming + gcloud storage cp "./build/${detached_signature}" "gs://releases.coder.com/coder-cli/${version}/${detached_signature}" done - name: Publish release From fd9f0a31921f874faff4d2b10dec8f3209dea167 Mon Sep 17 00:00:00 2001 From: Jakub Domeracki Date: Mon, 11 Aug 2025 12:15:12 +0200 Subject: [PATCH 2/4] fix: ensure that the detached signatures objects are named correctly --- .github/workflows/release.yaml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index bdc1e754f8172..4f0d969d03075 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -670,15 +670,11 @@ jobs: cli_binary="${cli_binaries[$i]}" # The detached signature file name remains the same as the slim binary name - detached_signature="${slim_binary}.asc" + source_detached_signature="${slim_binary}.asc" + target_detached_signature="${cli_binary}.asc" - echo "Copying ${slim_binary} to ${cli_binary}..." - # Copy the main binary, renaming it in the process gcloud storage cp "./build/${slim_binary}" "gs://releases.coder.com/coder-cli/${version}/${cli_binary}" - - echo "Copying ${detached_signature}..." - # Copy the signature file without renaming - gcloud storage cp "./build/${detached_signature}" "gs://releases.coder.com/coder-cli/${version}/${detached_signature}" + gcloud storage cp "./build/${source_detached_signature}" "gs://releases.coder.com/coder-cli/${version}/${target_detached_signature}" done - name: Publish release From 306fe1242bc1c981bb8da7dfbb80711fb0e247e5 Mon Sep 17 00:00:00 2001 From: Jakub Domeracki Date: Mon, 11 Aug 2025 12:23:58 +0200 Subject: [PATCH 3/4] fix: use an associative array --- .github/workflows/release.yaml | 49 +++++++++++----------------------- 1 file changed, 15 insertions(+), 34 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4f0d969d03075..99e2531285e81 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -641,40 +641,21 @@ jobs: version="$(./scripts/version.sh)" - # Source array of slim binaries - slim_binaries=( - "coder-slim_${version}_darwin_amd64" - "coder-slim_${version}_darwin_arm64" - "coder-slim_${version}_linux_amd64" - "coder-slim_${version}_linux_arm64" - "coder-slim_${version}_linux_armv7" - "coder-slim_${version}_windows_amd64.exe" - "coder-slim_${version}_windows_arm64.exe" - ) - - # Target array of CLI binary names - cli_binaries=( - "coder-darwin-amd64" - "coder-darwin-arm64" - "coder-linux-amd64" - "coder-linux-arm64" - "coder-linux-armv7" - "coder-windows-amd64.exe" - "coder-windows-arm64.exe" - ) - - # Map slim binaries from the filesystem to the resulting cli binary names in the GCS bucket - for ((i=0; i<${#slim_binaries[@]}; i++)); do - # Get the slim and cli binary names using the current index - slim_binary="${slim_binaries[$i]}" - cli_binary="${cli_binaries[$i]}" - - # The detached signature file name remains the same as the slim binary name - source_detached_signature="${slim_binary}.asc" - target_detached_signature="${cli_binary}.asc" - - gcloud storage cp "./build/${slim_binary}" "gs://releases.coder.com/coder-cli/${version}/${cli_binary}" - gcloud storage cp "./build/${source_detached_signature}" "gs://releases.coder.com/coder-cli/${version}/${target_detached_signature}" + # Source array of slim binaries + declare -A binaries + binaries["coder-darwin-amd64"]="coder-slim_${version}_darwin_amd64" + binaries["coder-darwin-arm64"]="coder-slim_${version}_darwin_arm64" + binaries["coder-linux-amd64"]="coder-slim_${version}_linux_amd64" + binaries["coder-linux-arm64"]="coder-slim_${version}_linux_arm64" + binaries["coder-linux-armv7"]="coder-slim_${version}_linux_armv7" + binaries["coder-windows-amd64.exe"]="coder-slim_${version}_windows_amd64.exe" + binaries["coder-windows-arm64.exe"]="coder-slim_${version}_windows_arm64.exe" + + for cli_name in "${!binaries[@]}"; do + slim_binary="${binaries[$cli_name]}" + detached_signature="${slim_binary}.asc" + gcloud storage cp "./build/${slim_binary}" "gs://releases.coder.com/coder-cli/${version}/${cli_name}" + gcloud storage cp "./build/${detached_signature}" "gs://releases.coder.com/coder-cli/${version}/${cli_name}.asc" done - name: Publish release From 15f373c1d01fe26fb572aeea982ca4d07c955c9f Mon Sep 17 00:00:00 2001 From: Jakub Domeracki Date: Mon, 11 Aug 2025 12:29:46 +0200 Subject: [PATCH 4/4] fix: fmt --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 99e2531285e81..05bcee392e789 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -641,7 +641,7 @@ jobs: version="$(./scripts/version.sh)" - # Source array of slim binaries + # Source array of slim binaries declare -A binaries binaries["coder-darwin-amd64"]="coder-slim_${version}_darwin_amd64" binaries["coder-darwin-arm64"]="coder-slim_${version}_darwin_arm64"