mirror of
https://github.com/agresdominik/ci-pipelines.git
synced 2026-07-21 21:20:54 +00:00
62 lines
1.4 KiB
YAML
62 lines
1.4 KiB
YAML
name: Go Releaser Check
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
go-version-file:
|
|
description: "Path to go.mod for version resolution"
|
|
type: string
|
|
default: "go.mod"
|
|
snapshot-artifact:
|
|
description: "Upload snapshot binaries as artifact"
|
|
type: boolean
|
|
default: false
|
|
|
|
jobs:
|
|
check:
|
|
name: goreleaser check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
- name: Validate .goreleaser.yaml
|
|
uses: goreleaser/goreleaser-action@v6
|
|
with:
|
|
version: latest
|
|
args: check
|
|
|
|
build:
|
|
name: goreleaser build (snapshot)
|
|
runs-on: ubuntu-latest
|
|
needs: check
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
- name: Build snapshot
|
|
uses: goreleaser/goreleaser-action@v6
|
|
with:
|
|
version: latest
|
|
args: build --snapshot --clean
|
|
|
|
- name: Upload snapshot binaries
|
|
if: ${{ inputs.snapshot-artifact }}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: snapshot-binaries
|
|
path: dist/
|
|
retention-days: 3
|