Skip to content

Commit 0953da9

Browse files
feat: publish standalone binaries via the release + Docker pipelines (ENG-12827)
Wire the standalone PyInstaller binaries (ENG-12826) into the release and Docker pipelines, dogfooding the freshly-built cloudsmith binary to authenticate (GitHub OIDC) and publish: - Publish per-platform archives + SHA256 to Cloudsmith and build/push the container image, using the built binary + OIDC and the Docker credential helper instead of cloudsmith-cli-action / static-key docker login. - GPG-sign the Linux archives (detached .sig sibling files). - Idempotent, immutable-repo-safe publishing (skip already-published artifacts/tags). - Tag raw uploads (os/arch/libc/target/type) for queryable CI selection. - Dockerfile: multi-stage Alpine, musl binary, non-root, OCI labels; Docker Hub floating tags. - CI hardening + perf: single-source target list, composite bootstrap action, GH_REPO for gh, trimmed clean-room docker runs, pinned runners. - Redact PII from online smoketest logs (SMOKETEST_DEBUG for detail). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 0f6f738 commit 0953da9

9 files changed

Lines changed: 654 additions & 181 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Set up cloudsmith binary
2+
description: >-
3+
Extract the linux-x86_64-gnu cloudsmith binary archive onto the runner and put
4+
it on PATH so jobs can dogfood the built CLI.
5+
6+
inputs:
7+
version:
8+
description: Release version (matches the binaries/cloudsmith-<version>-... archive).
9+
required: true
10+
add-local-bin:
11+
description: Also create ~/.local/bin and add it to PATH (for the docker credential helper launcher).
12+
required: false
13+
default: "false"
14+
15+
runs:
16+
using: composite
17+
steps:
18+
- shell: bash
19+
env:
20+
VERSION: ${{ inputs.version }}
21+
ADD_LOCAL_BIN: ${{ inputs.add-local-bin }}
22+
run: | # zizmor: ignore[github-env]
23+
set -euo pipefail
24+
ARCHIVE="binaries/cloudsmith-${VERSION}-linux-x86_64-gnu.tar.gz"
25+
test -f "${ARCHIVE}"
26+
DEST="${RUNNER_TEMP}/cloudsmith-cli"
27+
mkdir -p "${DEST}"
28+
tar -xzf "${ARCHIVE}" -C "${DEST}"
29+
chmod +x "${DEST}/cloudsmith/cloudsmith"
30+
echo "${DEST}/cloudsmith" >> "$GITHUB_PATH"
31+
if [ "${ADD_LOCAL_BIN}" = "true" ]; then
32+
mkdir -p "${HOME}/.local/bin"
33+
echo "${HOME}/.local/bin" >> "$GITHUB_PATH"
34+
fi

.github/workflows/binaries.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ jobs:
105105
run: |
106106
MATRIX=$(jq -c . <<'JSON'
107107
{"include":[
108-
{"name":"linux-x86_64-gnu","build_runner":"ubuntu-24.04","mode":"glibc","build_image":"almalinux:8@sha256:4a87d2615a770506e204c27d6248ac97f4df67f4e41e2e9c47c81f0ed0be98cb","test_runner":"ubuntu-24.04","test_kind":"docker","test_images":"debian:11-slim@sha256:ff4b13408ab702565720c6b23582ebda7bfdddfe9ce2b8c5b49e6d40430fdb05 almalinux:8@sha256:4a87d2615a770506e204c27d6248ac97f4df67f4e41e2e9c47c81f0ed0be98cb","archive":".tar.gz"},
108+
{"name":"linux-x86_64-gnu","build_runner":"ubuntu-24.04","mode":"glibc","build_image":"almalinux:8@sha256:4a87d2615a770506e204c27d6248ac97f4df67f4e41e2e9c47c81f0ed0be98cb","test_runner":"ubuntu-24.04","test_kind":"docker","test_images":"debian:11-slim@sha256:ff4b13408ab702565720c6b23582ebda7bfdddfe9ce2b8c5b49e6d40430fdb05","archive":".tar.gz"},
109109
{"name":"linux-x86_64-musl","build_runner":"ubuntu-24.04","mode":"alpine","build_image":"python:3.12-alpine@sha256:dbb1970cc04ce7d381c65efe8309c0c03d463e5b35c88f14d721796ad24cfbfd","test_runner":"ubuntu-24.04","test_kind":"docker","test_images":"alpine:3.20@sha256:d9e853e87e55526f6b2917df91a2115c36dd7c696a35be12163d44e6e2a4b6bc","archive":".tar.gz"},
110-
{"name":"linux-aarch64-gnu","build_runner":"ubuntu-24.04-arm","mode":"glibc","build_image":"almalinux:8@sha256:4a87d2615a770506e204c27d6248ac97f4df67f4e41e2e9c47c81f0ed0be98cb","test_runner":"ubuntu-24.04-arm","test_kind":"docker","test_images":"debian:11-slim@sha256:ff4b13408ab702565720c6b23582ebda7bfdddfe9ce2b8c5b49e6d40430fdb05 almalinux:8@sha256:4a87d2615a770506e204c27d6248ac97f4df67f4e41e2e9c47c81f0ed0be98cb","archive":".tar.gz"},
110+
{"name":"linux-aarch64-gnu","build_runner":"ubuntu-24.04-arm","mode":"glibc","build_image":"almalinux:8@sha256:4a87d2615a770506e204c27d6248ac97f4df67f4e41e2e9c47c81f0ed0be98cb","test_runner":"ubuntu-24.04-arm","test_kind":"docker","test_images":"debian:11-slim@sha256:ff4b13408ab702565720c6b23582ebda7bfdddfe9ce2b8c5b49e6d40430fdb05","archive":".tar.gz"},
111111
{"name":"linux-aarch64-musl","build_runner":"ubuntu-24.04-arm","mode":"alpine","build_image":"python:3.12-alpine@sha256:dbb1970cc04ce7d381c65efe8309c0c03d463e5b35c88f14d721796ad24cfbfd","test_runner":"ubuntu-24.04-arm","test_kind":"docker","test_images":"alpine:3.20@sha256:d9e853e87e55526f6b2917df91a2115c36dd7c696a35be12163d44e6e2a4b6bc","archive":".tar.gz"},
112112
{"name":"macos-arm64","build_runner":"macos-14","mode":"native","build_image":"","test_runner":"macos-14","test_kind":"macos","test_images":"","archive":".tar.gz"},
113113
{"name":"macos-x86_64","build_runner":"macos-15-intel","mode":"native","build_image":"","test_runner":"macos-15-intel","test_kind":"macos","test_images":"","archive":".tar.gz"},
@@ -186,15 +186,23 @@ jobs:
186186
tar -czf "out/${ART}" -C dist cloudsmith
187187
'
188188
189+
# Cache pip's download cache only (not site-packages); resolution still runs.
190+
- if: matrix.mode == 'glibc'
191+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
192+
with:
193+
path: ${{ github.workspace }}/.pip-cache
194+
key: pip-glibc-${{ matrix.name }}-${{ hashFiles('packaging/constraints.txt', 'uv.lock') }}
195+
189196
- if: matrix.mode == 'glibc'
190197
env:
191198
ART: ${{ steps.art.outputs.name }}
192199
BUILD_IMAGE: ${{ matrix.build_image }}
193200
run: |
194201
set -euo pipefail
195-
mkdir -p out
202+
mkdir -p out .pip-cache
196203
docker run --rm \
197204
-e ART="${ART}" \
205+
-e PIP_CACHE_DIR=/src/.pip-cache \
198206
-e PYINSTALLER_CONFIG_DIR=/tmp/pyinstaller \
199207
-v "${PWD}:/src" -w /src \
200208
"${BUILD_IMAGE}" bash -c '
@@ -315,7 +323,6 @@ jobs:
315323
env:
316324
ART: ${{ steps.art.outputs.name }}
317325
TEST_IMAGES: ${{ matrix.test_images }}
318-
EXPECTED_VERSION: ${{ github.ref_name }}
319326
run: |
320327
set -euo pipefail
321328
EXPECTED_VERSION=$(cat cloudsmith_cli/data/VERSION)

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ concurrency:
1717

1818
jobs:
1919
lint:
20-
runs-on: ubuntu-latest
20+
runs-on: ubuntu-24.04
2121
steps:
2222
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
2323
with:

0 commit comments

Comments
 (0)