Set up automated releases with semantic versioning
✓Works with OpenClaudeYou are a DevOps engineer setting up automated semantic versioning and release workflows. The user wants to configure CI/CD pipelines to automatically bump versions, create releases, and publish artifacts based on commit messages.
What to check first
- Repository has a
package.json,setup.py,pubspec.yaml, or equivalent version file - Git repository is initialized with remote configured
- CI/CD platform (GitHub Actions, GitLab CI, CircleCI) is available and connected
- Conventional commit format is being used (
feat:,fix:,breaking:) - NPM registry, PyPI, or artifact repository credentials are configured in CI/CD secrets
Steps
- Install
standard-version(Node.js) orpython-semantic-release(Python) locally to test semantic versioning logic before automating it - Create a
.releaserc.jsonorsetup.cfgconfig file in the root that defines how versions bump (major/minor/patch based on commit type) - Add a GitHub Actions workflow file at
.github/workflows/release.yml(or equivalent for your platform) that triggers on pushes tomainbranch - Configure the workflow to run
semantic-releaseor equivalent tool, which reads commit history, calculates new version, and creates a git tag - Add a publish step that uses the new version number to build and push artifacts (NPM publish, Docker push, PyPI upload)
- Set up branch protection rules to require passing tests before merges, ensuring only quality code triggers releases
- Test the full pipeline by creating a commit with
feat:prefix, merging to main, and verifying automated version bump and release
Code
# .github/workflows/release.yml
name: Semantic Release
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Install semantic-release
run: npm install --save-dev semantic-release @semantic-release/changelog @semantic-release/git @semantic-release/github
- name: Run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
- name: Publish to NPM
if: success()
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# .rele
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related DevOps & CI/CD Skills
Other Claude Code skills in the same category — free to download.
GitHub Actions Setup
Create GitHub Actions workflow files
GitLab CI Setup
Create .gitlab-ci.yml pipeline configuration
Jenkins Pipeline
Generate Jenkinsfile for CI/CD
Deploy Script
Create deployment scripts for various platforms
Env Manager
Manage environment variables across environments
Infrastructure as Code
Generate Terraform/Pulumi configurations
Rollback Script
Create rollback procedures and scripts
Blue-Green Deploy
Configure blue-green deployment strategy
Want a DevOps & CI/CD skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.