From 3d9628c27eb5a988a9ce1d4d0c3ffd6721c28fb1 Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Sun, 15 Mar 2026 06:56:18 -0700 Subject: [PATCH] ci: split build artifacts into per-platform uploads (#23081) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Splits the single `coder` artifact (containing all platforms in a 1.3GB zip) into individual artifacts per OS/arch/format. ## Problem All CI build artifacts are uploaded as a single artifact named `coder`, producing a 1.3GB zip containing every platform's binary. This makes it impossible to download a single platform's binary without pulling the entire bundle. ## Solution Upload each platform/format combination as a separate artifact: | Artifact Name | Contents | |---|---| | `coder-linux-amd64.tar.gz` | Linux amd64 tarball | | `coder-linux-amd64.deb` | Linux amd64 deb package | | `coder-linux-arm64.tar.gz` | Linux arm64 tarball | | `coder-linux-arm64.deb` | Linux arm64 deb package | | `coder-linux-armv7.tar.gz` | Linux armv7 tarball | | `coder-linux-armv7.deb` | Linux armv7 deb package | | `coder-windows-amd64.zip` | Windows amd64 zip | ## Plan This is the first step toward letting customers install directly from `main` via: ```bash curl -L https://coder.com/install.sh | sh -s -- --unsafe-unstable ``` GitHub Actions artifact downloads require authentication even for public repos, so the next steps are to add a small Cloudflare Worker (similar to the one we already have for `install.sh`) that: 1. Lists artifacts via the GitHub API (unauthenticated) to find the latest artifact ID for the requested platform 2. Calls the download endpoint with a GitHub token (CF Worker secret) to get a 302 redirect to a time-limited Azure Blob URL 3. Redirects the caller to that URL (which requires no auth) This gives us publicly accessible per-platform URLs that the `--unsafe-unstable` flag would point at. The worker doesn't proxy the binary itself — it only proxies the metadata API call (~1KB) and redirects for the actual download. This PR splits the artifacts so the worker can serve individual platform downloads (~200MB each) instead of forcing a 1.3GB bundle. --- .github/workflows/ci.yaml | 57 ++++++++++++++++++++++++++++++++++----- 1 file changed, 51 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 68bfc17fb5..1946efb52b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1438,15 +1438,60 @@ jobs: ^v prune-untagged: true - - name: Upload build artifacts + - name: Upload build artifact (coder-linux-amd64.tar.gz) if: github.ref == 'refs/heads/main' uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: - name: coder - path: | - ./build/*.zip - ./build/*.tar.gz - ./build/*.deb + name: coder-linux-amd64.tar.gz + path: ./build/*_linux_amd64.tar.gz + retention-days: 7 + + - name: Upload build artifact (coder-linux-amd64.deb) + if: github.ref == 'refs/heads/main' + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + with: + name: coder-linux-amd64.deb + path: ./build/*_linux_amd64.deb + retention-days: 7 + + - name: Upload build artifact (coder-linux-arm64.tar.gz) + if: github.ref == 'refs/heads/main' + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + with: + name: coder-linux-arm64.tar.gz + path: ./build/*_linux_arm64.tar.gz + retention-days: 7 + + - name: Upload build artifact (coder-linux-arm64.deb) + if: github.ref == 'refs/heads/main' + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + with: + name: coder-linux-arm64.deb + path: ./build/*_linux_arm64.deb + retention-days: 7 + + - name: Upload build artifact (coder-linux-armv7.tar.gz) + if: github.ref == 'refs/heads/main' + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + with: + name: coder-linux-armv7.tar.gz + path: ./build/*_linux_armv7.tar.gz + retention-days: 7 + + - name: Upload build artifact (coder-linux-armv7.deb) + if: github.ref == 'refs/heads/main' + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + with: + name: coder-linux-armv7.deb + path: ./build/*_linux_armv7.deb + retention-days: 7 + + - name: Upload build artifact (coder-windows-amd64.zip) + if: github.ref == 'refs/heads/main' + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + with: + name: coder-windows-amd64.zip + path: ./build/*_windows_amd64.zip retention-days: 7 # Deploy is handled in deploy.yaml so we can apply concurrency limits.