Skip to content

Release Workflow

The release.yml workflow automates the release process with changelog generation and GoDoc updates.

Usage

name: Release

on:
  push:
    tags:
      - 'v*.*.*'

permissions:
  contents: write

jobs:
  release:
    uses: go-gamma/actions/.github/workflows/release.yml@v1
    permissions:
      contents: write
    with:
      go-version: '1.24'

Features

Changelog Generation

Automatically generates changelog from commit history:

## What's Changed

* Add user authentication (abc1234)
* Fix login redirect issue (def5678)
* Update dependencies (ghi9012)

## Contributors

* @developer1
* @developer2

**Full Changelog**: https://github.com/org/repo/compare/v1.0.0...v1.1.0

GoDoc Update

Triggers pkg.go.dev to index the new version:

curl https://proxy.golang.org/module@version.info
curl https://sum.golang.org/lookup/module@version

GitHub Release

Creates a GitHub Release with:

  • Version tag as title
  • Generated changelog as body
  • Optional binary artifacts

Inputs

Input Type Default Description
go-version string '1.24' Go version
go-version-file string '' Path to go.mod
working-directory string '.' Code directory
generate-changelog boolean true Auto-generate changelog
update-godoc boolean true Trigger pkg.go.dev
draft boolean false Create as draft
prerelease boolean false Mark as prerelease
upload-artifacts boolean false Attach binaries
platforms string 'ubuntu-latest,...' Artifact platforms

Examples

Basic Release

on:
  push:
    tags: ['v*.*.*']

jobs:
  release:
    uses: go-gamma/actions/.github/workflows/release.yml@v1
    permissions:
      contents: write
    with:
      go-version: '1.24'

Draft Release

jobs:
  release:
    uses: go-gamma/actions/.github/workflows/release.yml@v1
    with:
      go-version: '1.24'
      draft: true  # Review before publishing

Prerelease

on:
  push:
    tags:
      - 'v*.*.*-*'  # v1.0.0-alpha, v1.0.0-beta.1

jobs:
  release:
    uses: go-gamma/actions/.github/workflows/release.yml@v1
    with:
      go-version: '1.24'
      prerelease: true

With Binaries

jobs:
  release:
    uses: go-gamma/actions/.github/workflows/release.yml@v1
    with:
      go-version: '1.24'
      upload-artifacts: true

Builds for:

  • Linux (amd64, arm64)
  • macOS (amd64, arm64)
  • Windows (amd64)

Creating Releases

Via Git Tag

git tag v1.0.0
git push origin v1.0.0

Via GitHub UI

  1. Go to Releases > Create a new release
  2. Enter tag version (e.g., v1.0.0)
  3. Click Publish release

Versioning

Follow Semantic Versioning:

Tag When to Use
v1.0.0 First stable release
v1.1.0 New features, backward compatible
v1.0.1 Bug fixes only
v2.0.0 Breaking changes
v1.0.0-alpha Prerelease