Generates a changelog with git-cliff and publishes a GitHub release with the run's artifacts.
name: release
on:
push:
tags: ["v*"]
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: rewire-run/actions/github-release@v1
with:
files: artifacts/*The action checks out and downloads artifacts itself, so the job needs no other steps. It does need
permissions: contents: write.
A repository that builds nothing must turn the artifact download off — actions/download-artifact fails when
the run produced no artifacts:
- uses: rewire-run/actions/github-release@v1
with:
download-artifacts: "false"- uses: rewire-run/actions/github-release@v1
with:
files: artifacts/*
prerelease: "true"Pair this with validate-tag so an rc tag cannot reach the stable release workflow, and vice
versa.
| Input | Required | Default | Description |
|---|---|---|---|
files |
no | — | Assets to attach. Empty means a notes-only release. |
name |
no | github.ref_name |
Release title. |
prerelease |
no | false |
Mark as a pre-release. |
changelog-config |
no | cliff.toml |
git-cliff configuration path. |
checkout |
no | true |
Check out at full depth before generating the changelog. |
download-artifacts |
no | true |
Download and merge the run's artifacts first. |
artifact-path |
no | artifacts |
Directory artifacts are downloaded into. |
None.
- Checks out at
fetch-depth: 0. This is not optional for a changelog: git-cliff walks history, and a shallow clone yields an empty changelog rather than an error. - Downloads every artifact from the run with
merge-multiple: trueintoartifact-path. - Runs git-cliff with
--latest --strip header. - Publishes with
softprops/action-gh-release, using the changelog as the body andgenerate_release_notes: falseso GitHub's autogenerated notes do not compete with git-cliff's.
Set checkout: "false" only if the job has already prepared the workspace in a way this would clobber — and
remember git-cliff still needs full history.