Skip to content

Commit bb2f804

Browse files
stack72claude
andauthored
fix: pin Deno Docker image and pass release version via job outputs (#883)
## Summary - **Pin Dockerfile base image** to `denoland/deno:2.7.5` instead of `:latest` for reproducible, deterministic builds - **Pass version via job outputs** from the `release` job to the `docker` job instead of querying `gh release view`, which could theoretically return a different release ## Impact These changes make the release pipeline more deterministic: 1. **Reproducible Docker builds** — Pinning the Deno base image means the same Dockerfile produces the same image regardless of when it's built. Previously, `:latest` meant builds could silently pick up a new Deno version with breaking changes or security issues. 2. **Correct version propagation** — The docker job now receives the exact version from the release job that created it via `needs.release.outputs.version`. Previously, `gh release view` returned the repo's latest release, which could be wrong if a manual release was created between jobs. ## Why this is correct - The `release` job already computes the version in the `version` step — we simply expose it as a job output - The `docker` job already declares `needs: release`, so the output is guaranteed to be available - No behavioral change in the happy path; this only eliminates edge-case failure modes Addresses review feedback from #882. ## Test plan - [ ] Verify CI passes on this PR - [ ] Confirm release workflow still builds and pushes Docker images correctly on next merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5871ffe commit bb2f804

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
release:
1818
name: Build and Release
1919
runs-on: ubuntu-latest
20+
outputs:
21+
version: ${{ steps.version.outputs.version }}
2022
# Only run on merged PRs (not closed without merge) or manual trigger
2123
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
2224

@@ -180,18 +182,17 @@ jobs:
180182
- name: Download Linux binaries from release
181183
env:
182184
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
185+
RELEASE_VERSION: ${{ needs.release.outputs.version }}
183186
run: |
184187
mkdir -p docker-build/linux-amd64 docker-build/linux-arm64
185-
# Find the release tag (use latest release since we just created it)
186-
LATEST_TAG=$(gh release view --json tagName -q .tagName)
187-
echo "Downloading binaries from release ${LATEST_TAG}"
188-
gh release download "${LATEST_TAG}" --pattern "swamp-linux-x86_64" --dir docker-build/linux-amd64
189-
gh release download "${LATEST_TAG}" --pattern "swamp-linux-aarch64" --dir docker-build/linux-arm64
188+
RELEASE_TAG="v${RELEASE_VERSION}"
189+
echo "Downloading binaries from release ${RELEASE_TAG}"
190+
gh release download "${RELEASE_TAG}" --pattern "swamp-linux-x86_64" --dir docker-build/linux-amd64
191+
gh release download "${RELEASE_TAG}" --pattern "swamp-linux-aarch64" --dir docker-build/linux-arm64
190192
mv docker-build/linux-amd64/swamp-linux-x86_64 docker-build/linux-amd64/swamp
191193
mv docker-build/linux-arm64/swamp-linux-aarch64 docker-build/linux-arm64/swamp
192194
chmod +x docker-build/linux-amd64/swamp docker-build/linux-arm64/swamp
193-
# Extract version from tag for Docker tagging
194-
echo "docker_tag=${LATEST_TAG#v}" >> "$GITHUB_ENV"
195+
echo "docker_tag=${RELEASE_VERSION}" >> "$GITHUB_ENV"
195196
196197
- name: Set up QEMU
197198
uses: docker/setup-qemu-action@v3

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM denoland/deno:latest
1+
FROM denoland/deno:2.7.5
22
COPY swamp /usr/local/bin/swamp
33
RUN chmod +x /usr/local/bin/swamp
44
WORKDIR /workspace

0 commit comments

Comments
 (0)