Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

github release

Generates a changelog with git-cliff and publishes a GitHub release with the run's artifacts.

Usage

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.

Notes-only releases

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"

Release candidates

- 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.

Inputs

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.

Outputs

None.

How it works

  • 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: true into artifact-path.
  • Runs git-cliff with --latest --strip header.
  • Publishes with softprops/action-gh-release, using the changelog as the body and generate_release_notes: false so 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.