Skip to content

Commit

Permalink
Feat: support multi-arch builds for releases
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Obuchowicz <[email protected]>
  • Loading branch information
AObuchow committed Jan 15, 2024
1 parent e9041b4 commit 8125d08
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ jobs:
with:
go-version: 1.20.10

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Clone source code
uses: actions/checkout@v3
with:
Expand Down
19 changes: 15 additions & 4 deletions make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ DWO_BUNDLE_QUAY_REPO="${DWO_BUNDLE_QUAY_REPO:-quay.io/devfile/devworkspace-opera
DWO_INDEX_IMAGE="${DWO_INDEX_IMAGE:-quay.io/devfile/devworkspace-operator-index:release}"
DWO_DIGEST_INDEX_IMAGE="${DWO_DIGEST_INDEX_IMAGE:-quay.io/devfile/devworkspace-operator-index:release-digest}"
MAIN_BRANCH="main"
ARCHITECTURES="linux/amd64,linux/arm64,linux/ppc64le,linux/s390x"
VERBOSE=""
TMP=""

Expand Down Expand Up @@ -156,10 +157,20 @@ update_images() {
build_and_push_images() {
DWO_QUAY_IMG="${DWO_QUAY_REPO}:${VERSION}"
PROJECT_CLONE_QUAY_IMG="${PROJECT_CLONE_QUAY_REPO}:${VERSION}"
docker build -t "${DWO_QUAY_IMG}" -f ./build/Dockerfile .
$DRY_RUN docker push "${DWO_QUAY_IMG}"
docker build -t "${PROJECT_CLONE_QUAY_IMG}" -f ./project-clone/Dockerfile .
$DRY_RUN docker push "${PROJECT_CLONE_QUAY_IMG}"

if [ "$DRY_RUN" == "dryrun" ]; then
docker buildx build . -t "${DWO_QUAY_IMG}" -f ./build/Dockerfile \
--platform "$ARCHITECTURES"
docker buildx build . -t "${PROJECT_CLONE_QUAY_IMG}" -f ./project-clone/Dockerfile \
--platform "$ARCHITECTURES"
else
docker buildx build . -t "${DWO_QUAY_IMG}" -f ./build/Dockerfile \
--platform "$ARCHITECTURES" \
--push
docker buildx build . -t "${PROJECT_CLONE_QUAY_IMG}" -f ./project-clone/Dockerfile \
--platform "$ARCHITECTURES" \
--push
fi
}

# Commit and push changes in local repo to remote (respecting DRY_RUN setting). If the branch cannot be pushed to,
Expand Down

0 comments on commit 8125d08

Please sign in to comment.