Opscraft
Build tools & artifact repositories · Lesson 5 of 9 · 3 min read

Versioning, reproducibility and supply chain

Semantic versioning

MAJOR.MINOR.PATCH — major for breaking changes, minor for backward-compatible features, patch for fixes; pre-release tags like 2.0.0-rc.1. For services deployed continuously, versions often include build metadata (1.4.0+build.512.sha.a1b2c3d) and the image is tagged with the git SHA; libraries consumed by others need strict semver.

Enlarge diagram241MAJORbreaking changeMINORnew feature, compatiblePATCHbug fix
Figure 1. Semantic versioning: which number to bump.
Swipe sideways to see all of it, or tap to open it full screen.

Reproducible builds

  • Pin dependency versions (no ranges like [1.0,) or latest), use lockfiles (gradle.lockfile, package-lock.json, poetry.lock/hashed requirements.txt, go.sum).
  • Pin build tool versions (wrappers) and JDK (toolchains or a pinned builder image).
  • Resolve only through your repository manager.
  • Same inputs ⇒ same output: avoid embedding timestamps (Maven project.build.outputTimestamp, Gradle isPreserveFileTimestamps = false, isReproducibleFileOrder = true).

Supply chain security

  • SBOM generation (CycloneDX Maven/Gradle plugins, Syft) attached to each artifact/image.
  • Dependency scanning — OWASP Dependency-Check, Snyk, Trivy, GitHub Dependabot alerts; fail on critical with exceptions tracked.
  • Signing and provenance — sign artifacts and images (Sigstore cosign), SLSA provenance from CI.
  • Least-privilege publish — only CI can publish releases; developers read-only; separate credentials per pipeline; short-lived tokens.
  • Typosquatting / dependency confusion — scoped namespaces (@acme/ in npm), exclusive internal routing, block-lists.
Enlarge diagramResolveonly through yourproxyScandependenciesand imageSBOMCycloneDX orSyftSigncosign, SLSAprovenancePublishCI identity only,short-lived token12345
Figure 2. Supply-chain controls along the build, from where dependencies come from to who may publish.
Swipe sideways to see all of it, or tap to open it full screen.