Release pipeline
Goal
Make a release a repeatable, auditable event: the thing tested in staging is byte for byte the thing that runs in production.
A good pipeline is short, fails early, and tells you which version runs where.
When to use
- Releases are manual, or built separately per environment.
- Nobody can say which commit is in production.
- The user wants tags, changelogs or approvals added.
- For basic test and lint workflows, use
use_skillwithci-workflowfirst.
Steps
- Read the current process: workflows with
rgunder CI folders, scripts, and the README release notes. Useread_fileon each. - Decide the trigger: tag push, merge to main, or manual dispatch. Match it with the team's branching style.
- Pick a versioning rule and apply it automatically: semantic version from tags, or commit hash plus date. Write the version into the artifact and the running app so it can be queried.
- Build once. Produce one artifact (image, package, bundle) and push it to a registry with an immutable tag and a digest. Never rebuild for production.
- Run gates in order of cost: lint and unit tests, build, integration tests, security scan of dependencies, then deploy to staging and run smoke tests.
- Promote by reference: production deploys the digest that passed staging. Environment differences come from config, not code. See
use_skillwithenv-config-management. - Add an approval step for production if the team wants it, using the platform's environment protection. Check current syntax in the docs with
read_url. - Generate release notes from merged changes with
run_commandon git log, and attach them to the release. - Record deployments: version, time, who or what triggered it, in the registry, a deploy log or tags.
- Add concurrency control so two pipeline runs cannot deploy to one environment at once, and cache dependencies for speed.
- Add a rollback path: redeploy a previous digest by one command or button.
- Write or edit the workflow files, then dry run on a branch and fix failures.
Gotchas
- Rebuilding per environment means production runs code that was never tested. Promote the same digest.
- Mutable tags such as
latestorv1make it impossible to say what is running or to roll back precisely. - Secrets available to pull request builds from forks can be exfiltrated. Restrict secrets to trusted triggers.
- Pipelines that auto deploy on every merge need fast, trusted tests. Without them add a manual gate.
- A version bumped by hand in several files drifts. Derive it from one source.
- Smoke tests that only hit the health route pass while the main flow is broken.
Output
- A diagram in words: trigger, build, gates, staging, approval, production.
- Workflow files created or edited and the dry run result.
- How to find what is deployed, and how to roll back.
