From e320f9f16ec18e7212cc40427ad943bfbb1c6e20 Mon Sep 17 00:00:00 2001 From: Owen Date: Sun, 21 Dec 2025 17:23:35 -0500 Subject: [PATCH] Handle the rc --- .github/workflows/cicd.yml | 51 ++++++++++++++++++++-- Makefile | 87 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 135 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index fc99b29f..6dee48fd 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -95,10 +95,25 @@ jobs: cat server/lib/consts.ts shell: bash + - name: Check if release candidate + id: check-rc + run: | + TAG=${{ env.TAG }} + if [[ "$TAG" == *".rc."* ]]; then + echo "IS_RC=true" >> $GITHUB_ENV + else + echo "IS_RC=false" >> $GITHUB_ENV + fi + shell: bash + - name: Build and push Docker images (Docker Hub - ARM64) run: | TAG=${{ env.TAG }} - make build-release-arm tag=$TAG + if [ "$IS_RC" = "true" ]; then + make build-rc-arm tag=$TAG + else + make build-release-arm tag=$TAG + fi echo "Built & pushed ARM64 images to: ${{ env.DOCKERHUB_IMAGE }}:${TAG}" shell: bash @@ -152,10 +167,25 @@ jobs: cat server/lib/consts.ts shell: bash + - name: Check if release candidate + id: check-rc + run: | + TAG=${{ env.TAG }} + if [[ "$TAG" == *".rc."* ]]; then + echo "IS_RC=true" >> $GITHUB_ENV + else + echo "IS_RC=false" >> $GITHUB_ENV + fi + shell: bash + - name: Build and push Docker images (Docker Hub - AMD64) run: | TAG=${{ env.TAG }} - make build-release-amd tag=$TAG + if [ "$IS_RC" = "true" ]; then + make build-rc-amd tag=$TAG + else + make build-release-amd tag=$TAG + fi echo "Built & pushed AMD64 images to: ${{ env.DOCKERHUB_IMAGE }}:${TAG}" shell: bash @@ -185,10 +215,25 @@ jobs: run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV shell: bash + - name: Check if release candidate + id: check-rc + run: | + TAG=${{ env.TAG }} + if [[ "$TAG" == *".rc."* ]]; then + echo "IS_RC=true" >> $GITHUB_ENV + else + echo "IS_RC=false" >> $GITHUB_ENV + fi + shell: bash + - name: Create multi-arch manifests run: | TAG=${{ env.TAG }} - make create-manifests tag=$TAG + if [ "$IS_RC" = "true" ]; then + make create-manifests-rc tag=$TAG + else + make create-manifests tag=$TAG + fi echo "Created multi-arch manifests for tag: ${TAG}" shell: bash diff --git a/Makefile b/Makefile index 3a1bbf59..ae31f50c 100644 --- a/Makefile +++ b/Makefile @@ -226,6 +226,93 @@ build-rc: --tag fosrl/pangolin:ee-postgresql-$(tag) \ --push . +build-rc-arm: + @if [ -z "$(tag)" ]; then \ + echo "Error: tag is required. Usage: make build-rc-arm tag="; \ + exit 1; \ + fi + docker buildx build \ + --build-arg BUILD=oss \ + --build-arg DATABASE=sqlite \ + --platform linux/arm64 \ + --tag fosrl/pangolin:$(tag)-arm64 \ + --push . && \ + docker buildx build \ + --build-arg BUILD=oss \ + --build-arg DATABASE=pg \ + --platform linux/arm64 \ + --tag fosrl/pangolin:postgresql-$(tag)-arm64 \ + --push . && \ + docker buildx build \ + --build-arg BUILD=enterprise \ + --build-arg DATABASE=sqlite \ + --platform linux/arm64 \ + --tag fosrl/pangolin:ee-$(tag)-arm64 \ + --push . && \ + docker buildx build \ + --build-arg BUILD=enterprise \ + --build-arg DATABASE=pg \ + --platform linux/arm64 \ + --tag fosrl/pangolin:ee-postgresql-$(tag)-arm64 \ + --push . + +build-rc-amd: + @if [ -z "$(tag)" ]; then \ + echo "Error: tag is required. Usage: make build-rc-amd tag="; \ + exit 1; \ + fi + docker buildx build \ + --build-arg BUILD=oss \ + --build-arg DATABASE=sqlite \ + --platform linux/amd64 \ + --tag fosrl/pangolin:$(tag)-amd64 \ + --push . && \ + docker buildx build \ + --build-arg BUILD=oss \ + --build-arg DATABASE=pg \ + --platform linux/amd64 \ + --tag fosrl/pangolin:postgresql-$(tag)-amd64 \ + --push . && \ + docker buildx build \ + --build-arg BUILD=enterprise \ + --build-arg DATABASE=sqlite \ + --platform linux/amd64 \ + --tag fosrl/pangolin:ee-$(tag)-amd64 \ + --push . && \ + docker buildx build \ + --build-arg BUILD=enterprise \ + --build-arg DATABASE=pg \ + --platform linux/amd64 \ + --tag fosrl/pangolin:ee-postgresql-$(tag)-amd64 \ + --push . + +create-manifests-rc: + @if [ -z "$(tag)" ]; then \ + echo "Error: tag is required. Usage: make create-manifests-rc tag="; \ + exit 1; \ + fi + @echo "Creating multi-arch manifests for RC sqlite (oss)..." && \ + docker buildx imagetools create \ + --tag fosrl/pangolin:$(tag) \ + fosrl/pangolin:$(tag)-arm64 \ + fosrl/pangolin:$(tag)-amd64 && \ + echo "Creating multi-arch manifests for RC postgresql (oss)..." && \ + docker buildx imagetools create \ + --tag fosrl/pangolin:postgresql-$(tag) \ + fosrl/pangolin:postgresql-$(tag)-arm64 \ + fosrl/pangolin:postgresql-$(tag)-amd64 && \ + echo "Creating multi-arch manifests for RC sqlite (enterprise)..." && \ + docker buildx imagetools create \ + --tag fosrl/pangolin:ee-$(tag) \ + fosrl/pangolin:ee-$(tag)-arm64 \ + fosrl/pangolin:ee-$(tag)-amd64 && \ + echo "Creating multi-arch manifests for RC postgresql (enterprise)..." && \ + docker buildx imagetools create \ + --tag fosrl/pangolin:ee-postgresql-$(tag) \ + fosrl/pangolin:ee-postgresql-$(tag)-arm64 \ + fosrl/pangolin:ee-postgresql-$(tag)-amd64 && \ + echo "All RC multi-arch manifests created successfully!" + build-arm: docker buildx build --platform linux/arm64 -t fosrl/pangolin:latest .