From 54038c2512469f807e0e2295b374cdc8f9945ad0 Mon Sep 17 00:00:00 2001 From: sai80082 Date: Fri, 1 May 2026 16:17:03 +0530 Subject: [PATCH 1/2] feat: enhance release workflow with multi-platform support --- .github/workflows/release.yml | 95 ++++++++++++++++++++++++++++------- 1 file changed, 78 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e1ea781..d57528b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,28 +7,35 @@ on: jobs: build: - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - platform: linux/amd64 + runner: ubuntu-24.04 + - platform: linux/arm64 + runner: ubuntu-24.04-arm + runs-on: ${{ matrix.runner }} permissions: - contents: write + contents: read packages: write steps: - - uses: actions/checkout@v3 + - name: Prepare platform pair + run: | + platform=${{ matrix.platform }} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV + + - uses: actions/checkout@v6 - name: Extract version from tag id: version run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT - uses: docker/metadata-action@v5 - name: Docker meta id: meta with: - images: | - ghcr.io/${{ github.repository }} - tags: | - type=raw,value=latest - type=semver,pattern={{major}}.{{minor}}.{{patch}} - type=raw,value=${{ github.ref_name }} + images: ghcr.io/${{ github.repository }} - uses: docker/setup-buildx-action@v3 @@ -38,19 +45,73 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v6 + - name: Build and push by digest + id: build + uses: docker/build-push-action@v7 with: context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.meta.outputs.tags }} + platforms: ${{ matrix.platform }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max + outputs: type=image,name=ghcr.io/${{ github.repository }},push-by-digest=true,name-canonical=true,push=true + cache-from: type=gha,scope=${{ env.PLATFORM_PAIR }} + cache-to: type=gha,mode=max,scope=${{ env.PLATFORM_PAIR }} build-args: | VERSION=${{ steps.version.outputs.VERSION }} + - name: Export digest + run: | + mkdir -p ${{ runner.temp }}/digests + digest="${{ steps.build.outputs.digest }}" + touch "${{ runner.temp }}/digests/${digest#sha256:}" + + - uses: actions/upload-artifact@v4 + with: + name: digests-${{ env.PLATFORM_PAIR }} + path: ${{ runner.temp }}/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-24.04 + needs: build + permissions: + contents: write + packages: write + + steps: + - uses: actions/download-artifact@v4 + with: + path: ${{ runner.temp }}/digests + pattern: digests-* + merge-multiple: true + + - uses: docker/setup-buildx-action@v3 + + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - uses: docker/metadata-action@v5 + id: meta + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=raw,value=latest + type=semver,pattern={{major}}.{{minor}}.{{patch}} + type=raw,value=${{ github.ref_name }} + + - name: Create manifest list and push + working-directory: ${{ runner.temp }}/digests + run: | + docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ + $(printf 'ghcr.io/${{ github.repository }}@sha256:%s ' *) + + - name: Inspect image + run: | + docker buildx imagetools inspect ghcr.io/${{ github.repository }}:${{ steps.meta.outputs.version }} + - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: From e3c71704481b8eecedaaf1697671632079cd2273 Mon Sep 17 00:00:00 2001 From: tikibozo <4793440+tikibozo@users.noreply.github.com> Date: Thu, 21 May 2026 00:37:39 -0700 Subject: [PATCH 2/2] fix(api): raise bodyParser limit on albums-by-assets The /api/assets/albums-by-assets route accepts a POST body shaped { assetIds: string[] } and is invoked from the bulk-duplicate-finder page with every asset across every duplicate group. With a large duplicate set the body easily exceeds Next.js's default 1 MB bodyParser limit and the route returns 413 before the handler runs. Concrete case: a library with ~14,500 duplicate groups produces a request body around 1.4-1.8 MB, which is rejected. The page renders but never finishes loading (413 in browser console). Fix: add the per-route Next.js bodyParser config to bump the limit to 10 MB, leaving plenty of headroom for very large libraries while still bounding worst-case request size. --- src/pages/api/assets/albums-by-assets.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pages/api/assets/albums-by-assets.ts b/src/pages/api/assets/albums-by-assets.ts index 3573a9a..cf29784 100644 --- a/src/pages/api/assets/albums-by-assets.ts +++ b/src/pages/api/assets/albums-by-assets.ts @@ -5,6 +5,14 @@ import { albums } from "@/schema/albums.schema"; import { albumsAssetsAssets } from "@/schema/albumAssetsAssets.schema"; import { eq, inArray, and } from "drizzle-orm"; +export const config = { + api: { + bodyParser: { + sizeLimit: "10mb", + }, + }, +}; + export default async function handler( req: NextApiRequest, res: NextApiResponse