Skip to content

chore(cli): bump Go to 1.26.1 and apply go fix #1

chore(cli): bump Go to 1.26.1 and apply go fix

chore(cli): bump Go to 1.26.1 and apply go fix #1

Workflow file for this run

name: CLI Binaries
on:
push:
tags:
- "cli-v*"
workflow_dispatch:
inputs:
tag:
description: "Release tag to publish (e.g. cli-v0.1.0)"
required: true
type: string
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- goos: linux
goarch: amd64
archive_ext: tar.gz
- goos: linux
goarch: arm64
archive_ext: tar.gz
- goos: darwin
goarch: amd64
archive_ext: tar.gz
- goos: darwin
goarch: arm64
archive_ext: tar.gz
- goos: windows
goarch: amd64
archive_ext: zip
- goos: windows
goarch: arm64
archive_ext: zip
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: cli/go.mod
- name: Build binary
shell: bash
env:
CGO_ENABLED: "0"
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
set -euo pipefail
mkdir -p dist
binary_name="agentation"
if [[ "$GOOS" == "windows" ]]; then
binary_name="${binary_name}.exe"
fi
target_dir="dist/agentation-${GOOS}-${GOARCH}"
mkdir -p "$target_dir"
go build -trimpath -ldflags="-s -w" -o "$target_dir/$binary_name" ./cli/cmd/agentation
cp cli/README.md "$target_dir/README.md"
cp LICENSE "$target_dir/LICENSE"
- name: Archive build
shell: bash
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
ARCHIVE_EXT: ${{ matrix.archive_ext }}
run: |
set -euo pipefail
base="agentation-${GOOS}-${GOARCH}"
pushd dist >/dev/null
if [[ "$ARCHIVE_EXT" == "zip" ]]; then
zip -r "${base}.zip" "$base"
else
tar -czf "${base}.tar.gz" "$base"
fi
popd >/dev/null
- name: Upload archive artifact
uses: actions/upload-artifact@v4
with:
name: cli-${{ matrix.goos }}-${{ matrix.goarch }}
path: |
dist/agentation-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz
dist/agentation-${{ matrix.goos }}-${{ matrix.goarch }}.zip
if-no-files-found: ignore
publish:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: dist
pattern: cli-*
merge-multiple: true
- name: Generate checksums
shell: bash
run: |
set -euo pipefail
cd dist
sha256sum agentation-* > checksums.txt
- name: Publish release assets
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref_name }}
files: |
dist/agentation-*.tar.gz
dist/agentation-*.zip
dist/checksums.txt
generate_release_notes: true