Skip to content
Latchkey

How to Create a GitHub Release from a Tag in GitHub Actions

A tag push can build artifacts and publish a Release with generated notes in one run.

Trigger on push tags matching v*, build the artifacts, then create the Release with softprops/action-gh-release.

Steps

  • Trigger on tags matching your version pattern.
  • Build the artifacts to attach.
  • Create the Release with generated notes and the artifact files.

Workflow

.github/workflows/release.yml
on:
  push:
    tags: ['v*']
permissions:
  contents: write
jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: make dist
      - uses: softprops/action-gh-release@v2
        with:
          generate_release_notes: true
          files: dist/*

Gotchas

  • Push an annotated tag; lightweight tags can produce sparse notes.
  • The job needs contents: write to create the Release.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →