Skip to content

CI/CD Templates

Copy one of the templates below into your project to get a working semrel release pipeline in under a minute. Every snippet triggers on pushes to your default branch and runs semrel release with sane defaults.

Uses the official composite action — no Node.js wrapper, just downloads and builds the Go binary for the runner.

.github/workflows/release.yml
name: Release
on:
push:
branches: [main]
concurrency:
group: release
cancel-in-progress: false
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: SemRels/semrel@v0
id: semrel
with:
dry-run: 'false'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Use outputs
if: steps.semrel.outputs.released == 'true'
run: echo "Released ${{ steps.semrel.outputs.version }}"

All templates read the same configuration file and honor these environment variables regardless of the CI platform:

VariableDescription
SEMREL_TOKENToken used by provider/publisher plugins (create tags, releases, comments)
SEMREL_DRY_RUNSet to true to simulate a release without side effects
SEMREL_CONFIGOverride the path to .semrel.yaml

See CI Outputs for how to consume the computed version, tag, and changelog in downstream steps across GitHub Actions and GitLab CI.