C.W.K.
Stream
Lesson 11 of 13 · published

Build Artifacts

~11 min · artifacts, build, immutable

Level 0Apprentice
0 XP0/101 lessons0/10 achievements
0/120 XP to next level120 XP to go0% complete

Build once, ship that exact thing

The 'build once, deploy many' principle from the foundations track plays out in the artifact pipeline. The artifact is what you actually ship. It must be:

  1. Reproducible — the same source produces a bit-equivalent artifact on a fresh machine.
  2. Versioned — has a unique name (Git SHA, semantic version, timestamp).
  3. Immutable — once published, never overwritten.
  4. Verifiable — has a checksum, signature, or both.

Artifact storage destinations

  • GitHub Releases — for human-shippable binaries (CLI tools, installers).
  • GitHub Container Registry (ghcr.io) — for Docker images.
  • npm / PyPI / crates.io — for language packages.
  • S3 / R2 / GCS — for general blobs.
  • Internal artifact stores — Artifactory, Nexus, etc.

Versioning

Two common schemes:

  • SemVer + Git SHAv1.4.2+abc1234 for human-shippable releases. SemVer for API stability promise; SHA for traceability.
  • Date + SHA2026-04-30-abc1234 for internal builds that don't have user-facing semantics.

Code

Build a Python wheel + checksum + upload·yaml
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: astral-sh/setup-uv@v3
      - run: uv build  # produces dist/*.whl + dist/*.tar.gz
      - name: Compute checksums
        working-directory: dist
        run: sha256sum *.whl *.tar.gz > SHA256SUMS
      - uses: actions/upload-artifact@v4
        with:
          name: wheels-${{ github.sha }}
          path: dist/

External links

Exercise

Run your build twice on a clean machine (or two clean runners). Compute SHA256 of the outputs. Are they identical? If not, identify what's not deterministic (timestamps, build IDs, embedded paths) and pin or scrub them.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.