lukaszraczylo 6f59ddd894 fix: add condition to release job to prevent skipping when build succeeds
The release job needs an explicit if condition to run even when optional
jobs like frontend are skipped. Without this, GitHub Actions skips the
release job when any dependency doesn't have 'success' status.

Now release will run as long as version and build jobs succeed.
2026-01-03 22:59:55 +00:00
2025-12-14 19:54:19 +00:00

Shared GitHub Actions

Reusable workflows and composite actions for Go projects.

Reusable Workflows

go-release.yaml

Standard Go release workflow using GoReleaser.

jobs:
  release:
    uses: lukaszraczylo/shared-actions/.github/workflows/go-release.yaml@main
    with:
      go-version: ">=1.24"
      docker-enabled: true  # optional
    secrets: inherit

Inputs:

Input Default Description
go-version >=1.24 Go version
semver-config semver.yaml Path to semver config
docker-enabled false Enable Docker builds
docker-registry ghcr.io Docker registry
rolling-release-tag "" Rolling release tag (e.g., v1)

go-release-cgo.yaml

Go release workflow for CGO-enabled projects. Builds natively on each platform.

jobs:
  release:
    uses: lukaszraczylo/shared-actions/.github/workflows/go-release-cgo.yaml@main
    with:
      go-version: ">=1.24"
      node-enabled: true
      node-build-script: "cd ui && npm ci && npm run build"
    secrets: inherit

Inputs:

Input Default Description
go-version >=1.24 Go version
semver-config semver.yaml Path to semver config
rolling-release-tag "" Rolling release tag
node-enabled false Enable Node.js
node-version 20 Node.js version
node-build-script "" Frontend build script
platforms (all 4) JSON array of platforms

go-pr.yaml

Pull request checks: tests, linting, security scans.

jobs:
  pr-checks:
    uses: lukaszraczylo/shared-actions/.github/workflows/go-pr.yaml@main
    with:
      go-version: ">=1.24"
    secrets: inherit

go-autoupdate.yaml

Automatic dependency updates.

jobs:
  autoupdate:
    uses: lukaszraczylo/shared-actions/.github/workflows/go-autoupdate.yaml@main
    with:
      go-version: ">=1.24"
      release-workflow: "release.yaml"
    secrets: inherit

Composite Actions

actions/go-test

Run Go tests.

- uses: lukaszraczylo/shared-actions/.github/actions/go-test@main
  with:
    go-version: ">=1.24"
    cgo-enabled: "1"  # optional, default "0"

actions/semver

Calculate semantic version.

- id: semver
  uses: lukaszraczylo/shared-actions/.github/actions/semver@main
  with:
    config-file: semver.yaml

- run: echo "Version: ${{ steps.semver.outputs.version_tag }}"

actions/goreleaser

Run GoReleaser with mode support.

# Full release (single runner)
- uses: lukaszraczylo/shared-actions/.github/actions/goreleaser@main
  with:
    version-tag: v1.0.0
    mode: full
    github-token: ${{ secrets.GITHUB_TOKEN }}

# Split build (matrix)
- uses: lukaszraczylo/shared-actions/.github/actions/goreleaser@main
  with:
    version-tag: v1.0.0
    mode: split
    cgo-enabled: "1"
    github-token: ${{ secrets.GITHUB_TOKEN }}

# Merge artifacts
- uses: lukaszraczylo/shared-actions/.github/actions/goreleaser@main
  with:
    version-tag: v1.0.0
    mode: merge
    github-token: ${{ secrets.GITHUB_TOKEN }}

actions/rolling-release

Create/update a rolling release tag.

- uses: lukaszraczylo/shared-actions/.github/actions/rolling-release@main
  with:
    tag: v1
    version-tag: v1.2.3
    github-token: ${{ secrets.GITHUB_TOKEN }}

actions/node-build

Setup Node.js and run build script.

- uses: lukaszraczylo/shared-actions/.github/actions/node-build@main
  with:
    node-version: "20"
    build-script: "cd ui && npm ci && npm run build"

Outputs

Both release workflows output:

  • version - Calculated version without v prefix (e.g., 1.2.3)
  • version_tag - Version with v prefix (e.g., v1.2.3)
S
Description
Mirror of github.com/lukaszraczylo/shared-actions
Readme 118 KiB