Skip to content

ci: Don't clean, just release #48

ci: Don't clean, just release

ci: Don't clean, just release #48

Workflow file for this run

name: goreleaser
on:
push:
tags:
- "*"
workflow_dispatch: # Allow triggering manually.
# ${{ secrets.GH_PAT }}
jobs:
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.24"
- name: Setup Linux build environment
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get update && sudo apt-get install -y build-essential
- name: Setup macOS build environment
if: startsWith(matrix.os, 'macos')
run: brew install gcc
- name: Setup Windows build environment
if: startsWith(matrix.os, 'windows')
run: |
choco install mingw
echo "Path=C:/tools/mingw64/bin;$env:Path" | Out-File -FilePath $env:GITHUB_PATH -Append
- name: Set build ID
id: buildid
run: |
case "${{ runner.os }}" in
macOS)
echo "id=darwin-build" >> $GITHUB_OUTPUT
;;
Windows)
echo "id=windows-build" >> $GITHUB_OUTPUT
;;
Linux)
echo "id=linux-build" >> $GITHUB_OUTPUT
;;
*)
echo "id=unknown-runner-os-${{ runner.os }}" >> $GITHUB_OUTPUT
;;
esac
shell: bash
- name: Build with GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: build --clean --id ${{ steps.buildid.outputs.id }}
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts-${{ matrix.os }}
path: |
dist/*
if-no-files-found: error
publish:
name: Publish
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Download Linux artifacts
uses: actions/download-artifact@v4
with:
name: artifacts-ubuntu-latest
path: dist/
- name: Download macOS artifacts
uses: actions/download-artifact@v4
with:
name: artifacts-macos-latest
path: dist/
- name: Download Windows artifacts
uses: actions/download-artifact@v4
with:
name: artifacts-windows-latest
path: dist/
- name: Publish with GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}