GitLab CI/CD Semantic Release & Changelog Automation Prompt
Automate versioning and releases — derive SemVer from Conventional Commits, generate a changelog, create the GitLab Release + Git tag, and publish artifacts, all from a protected pipeline.
- Target user
- Engineers replacing manual version bumps and release notes with automation
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a release-automation engineer who sets up zero-touch SemVer releases in GitLab CI driven by commit history, not humans editing version files. I will provide: - My language/package ecosystem (npm, Python, Go, container image, multi-artifact) - Current release process (manual tags? hand-written changelog?) - Commit conventions (Conventional Commits or not) and branch strategy - Where artifacts publish (npm, PyPI, GitLab Package Registry, container registry) Your job: 1. **Pick the engine** — `semantic-release` (rich plugin ecosystem) vs GitLab's native `release-cli` + the `glab`/changelog API, vs `release-please`. Recommend one for my ecosystem and explain the tradeoff. 2. **Establish commit hygiene** — Conventional Commits map (`feat`→minor, `fix`→patch, `feat!`/`BREAKING CHANGE`→major); add a commit-lint job on MRs so the version derivation is reliable. Show the lint job. 3. **Build the release job** — runs only on the default/protected branch (`rules: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH`), computes the next version, generates the changelog, and creates the GitLab Release with `release:` keyword (or `release-cli`). Provide the job. 4. **Authentication** — releasing creates tags/releases, so it needs a token that can push to a protected branch/tag: a Project Access Token or `CI_JOB_TOKEN` with the right scope, stored masked+protected. Spell out the least-privilege token and tag-protection rules. 5. **Avoid the loop** — the release commit (version bump/changelog) must NOT retrigger the pipeline; use `[skip ci]` or `rules` excluding the bot author. Show the guard. 6. **Publish artifacts** — tie the version into the build so the published npm/PyPI/image tag matches the SemVer and the GitLab Release `assets:links` point to them. 7. **Validate** — dry-run on a non-default branch, confirm version + changelog + tag + release + published artifact all agree, and that the bot commit didn't loop. Output: (a) the commit-lint MR job, (b) the release job with `release:`/`release-cli`, (c) the least-privilege token + tag protection, (d) the skip-ci loop guard, (e) a dry-run validation plan. Bias toward: history-derived versions, least-privilege release tokens, and no infinite pipeline loops.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
GitLab CI/CD k6 Load Test Performance Gate Prompt
Design a .gitlab-ci.yml stage that runs k6 load/performance tests against a review or staging environment, enforces threshold-based pass/fail gates, and surfaces results as artifacts and metrics reports in merge requests.
-
GitLab CI/CD Publish to the Package Registry (npm, Maven, generic) Prompt
Design .gitlab-ci.yml jobs that build and publish versioned artifacts to the project or group Package Registry using CI_JOB_TOKEN auth, with proper version gating, immutability, and consumer install config.
-
GitLab CI/CD Windows Runner & PowerShell Pipeline Prompt
Design .gitlab-ci.yml pipelines that run on Windows runners (shell or docker-windows executor) with correct PowerShell shell handling, tag targeting, path/quoting fixes, and mixed Linux/Windows stages.
-
GitLab CI/CD Component Versioning and Release Publishing Prompt
Design a release and semantic-versioning workflow that publishes CI/CD Catalog components to the catalog on tag, manages ~latest vs. pinned versions, and gives consumers a safe upgrade path without breaking downstream pipelines.
More GitLab CI/CD prompts & error guides
Browse every GitLab CI/CD prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.