Skip to content

Commit 16d12e0

Browse files
bpmctclaude
andcommitted
feat: update release workflow for RISC-V support
Updated GitHub workflows and Dockerfile.base to include RISC-V architecture: - Added riscv64 platform to Docker build configurations - Added RISC-V verification step for container builds - Updated Dockerfile.base to handle RISC-V architecture detection - Added special handling for Terraform on RISC-V (not available) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 7236995 commit 16d12e0

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

.github/workflows/release.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ jobs:
305305
version="$(./scripts/version.sh)"
306306
make gen/mark-fresh
307307
make -j \
308-
build/coder_"$version"_linux_{amd64,armv7,arm64}.{tar.gz,apk,deb,rpm} \
308+
build/coder_"$version"_linux_{amd64,armv7,arm64,riscv64}.{tar.gz,apk,deb,rpm} \
309309
build/coder_"$version"_{darwin,windows}_{amd64,arm64}.zip \
310310
build/coder_"$version"_windows_amd64_installer.exe \
311311
build/coder_helm_"$version".tgz \
@@ -359,7 +359,7 @@ jobs:
359359
project: wl5hnrrkns
360360
context: base-build-context
361361
file: scripts/Dockerfile.base
362-
platforms: linux/amd64,linux/arm64,linux/arm/v7
362+
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/riscv64
363363
provenance: true
364364
pull: true
365365
no-cache: true
@@ -391,11 +391,12 @@ jobs:
391391
jq -r '.manifests[].platform | .os + "/" + .architecture + (if .variant then "/" + .variant else "" end)'
392392
)
393393
394-
# Verify all 3 platforms are present.
394+
# Verify all 4 platforms are present.
395395
set -euxo pipefail
396396
echo "$manifests" | grep -q linux/amd64
397397
echo "$manifests" | grep -q linux/arm64
398398
echo "$manifests" | grep -q linux/arm/v7
399+
echo "$manifests" | grep -q linux/riscv64
399400
400401
- name: Build Linux Docker images
401402
run: |
@@ -410,7 +411,7 @@ jobs:
410411
411412
# build Docker images for each architecture
412413
version="$(./scripts/version.sh)"
413-
make build/coder_"$version"_linux_{amd64,arm64,armv7}.tag
414+
make build/coder_"$version"_linux_{amd64,arm64,armv7,riscv64}.tag
414415
415416
# build and push multi-arch manifest, this depends on the other images
416417
# being pushed so will automatically push them.
@@ -423,7 +424,7 @@ jobs:
423424
./scripts/build_docker_multiarch.sh \
424425
--push \
425426
--target "$(./scripts/image_tag.sh --version latest)" \
426-
$(cat build/coder_"$version"_linux_{amd64,arm64,armv7}.tag)
427+
$(cat build/coder_"$version"_linux_{amd64,arm64,armv7,riscv64}.tag)
427428
fi
428429
env:
429430
CODER_BASE_IMAGE_TAG: ${{ steps.image-base-tag.outputs.tag }}

scripts/Dockerfile.base

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,23 @@ RUN apk add --no-cache \
2626
# Terraform was disabled in the edge repo due to a build issue.
2727
# https://gitlab.alpinelinux.org/alpine/aports/-/commit/f3e263d94cfac02d594bef83790c280e045eba35
2828
# Using wget for now. Note that busybox unzip doesn't support streaming.
29-
RUN ARCH="$(arch)"; if [ "${ARCH}" == "x86_64" ]; then ARCH="amd64"; elif [ "${ARCH}" == "aarch64" ]; then ARCH="arm64"; fi; wget -O /tmp/terraform.zip "https://releases.hashicorp.com/terraform/1.11.0/terraform_1.11.0_linux_${ARCH}.zip" && \
30-
busybox unzip /tmp/terraform.zip -d /usr/local/bin && \
31-
rm -f /tmp/terraform.zip && \
32-
chmod +x /usr/local/bin/terraform && \
33-
terraform --version
29+
RUN ARCH="$(arch)"; \
30+
if [ "${ARCH}" == "x86_64" ]; then \
31+
ARCH="amd64"; \
32+
elif [ "${ARCH}" == "aarch64" ]; then \
33+
ARCH="arm64"; \
34+
elif [ "${ARCH}" == "riscv64" ]; then \
35+
ARCH="riscv64"; \
36+
fi; \
37+
if [ "${ARCH}" == "riscv64" ]; then \
38+
echo "RISC-V detected - Terraform not available for this architecture. Skipping..."; \
39+
else \
40+
wget -O /tmp/terraform.zip "https://releases.hashicorp.com/terraform/1.11.0/terraform_1.11.0_linux_${ARCH}.zip" && \
41+
busybox unzip /tmp/terraform.zip -d /usr/local/bin && \
42+
rm -f /tmp/terraform.zip && \
43+
chmod +x /usr/local/bin/terraform && \
44+
terraform --version; \
45+
fi
3446
USER 1000:1000
3547
ENV HOME=/home/coder
3648
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt

0 commit comments

Comments
 (0)