Versions and artifacts: know exactly what you shipped
Semantic versions, tags, artifacts, registries and digests, and why you build once and promote the same file.
Every deployable thing needs a name that points to exactly one build. Semantic versioning (MAJOR.MINOR.PATCH) tells people what changed: a new major version may break them, a minor one adds features, a patch fixes bugs. For builds between releases, the commit SHA is a good identifier.
Artifacts are files a pipeline keeps: zipped sites, packages, test reports. Registries keep the important ones longer: container images in GHCR or Azure Container Registry, packages in GitHub Packages or Azure Artifacts. A container image's digest is the only truly fixed reference; tags can be moved.
Build once, promote many: build in one place, test that build, then deploy the same file or digest to each environment. Rebuilding for production means production runs something nobody tested.
Cost. Free on GitHub for public repositories; private artifact and package storage counts towards your plan.
Use it when
- you can't say which commit is running in production.
- test passed but production behaves differently.
- you're setting up release numbering.
How it works
- Version
- Semantic versions for releases, SHAs for everything else.
- Tag
- A Git tag starts the release workflow.
- Artifact
- The pipeline uploads the built file once.
- Registry
- Long-lived storage for images and packages.
- Promote
- Each environment gets the same file or digest.
Options
- Version from Git tags
- Simple and visible; a person decides the number.
- Version from commit messages
- Tools such as release-please work it out from conventional commits.
- Date-based versions
- Fine for apps no one depends on, such as websites.
Example. Quayhurst Health labels every image with the commit SHA and the release version, and their status page shows the digest running in each environment. When a bug report arrives, they know the exact code within seconds.
Don't confuse it with
- Artifact
- A file kept by a run, for days or weeks.
- Package or image
- Kept in a registry for as long as you need, with versions.
Words to know
- Semantic versioning
- MAJOR.MINOR.PATCH numbering that signals how big a change is.
- Digest
- A hash that names exactly one image.
- Promotion
- Moving the same build from one environment to the next.
Where to look
- Releases
- Packages
- Actions artifacts
Practise it
- Version a build and pass it between jobsHow-to, Free
- Build and publish a container image with clear tagsHow-to, Free
Read it in the guide, next to the tasks and labs.
Open in DevOps, Hands On