Skip to content

fix: upload the slim binaries from the build directory to the GCS bucket #19281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 11, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: use an associative array
  • Loading branch information
jdomeracki-coder committed Aug 11, 2025
commit 306fe1242bc1c981bb8da7dfbb80711fb0e247e5
49 changes: 15 additions & 34 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down