Switches CLI flag parsing from Go's stdlib `flag` to spf13/pflag so `--project` (and the internal `--socket` / `--identity` / `--scenario` flags) are the only accepted form; single-hyphen long flags like `-project` are now rejected. Help output renders the canonical `--` form. Adds `patterm --version`, which prints the build version, short commit, and build date (e.g. `patterm v0.0.1 (commit abc1234, built 2026-05-14)`). The version string is injected at build time — `make patterm` derives it from `git describe --tags --always --dirty`, and the release workflow injects the pushed tag. Commit/date come from the Go toolchain's embedded VCS info via `runtime/debug.ReadBuildInfo`, so no manual bumping is required.
42 lines
896 B
YAML
42 lines
896 B
YAML
name: release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
build-linux-amd64:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
- uses: mlugg/setup-zig@v1
|
|
with:
|
|
version: 0.15.2
|
|
|
|
- name: Build libghostty-vt
|
|
run: make deps
|
|
|
|
- name: Build patterm
|
|
env:
|
|
GOOS: linux
|
|
GOARCH: amd64
|
|
CGO_ENABLED: 1
|
|
run: |
|
|
mkdir -p dist
|
|
go build -trimpath \
|
|
-ldflags="-s -w -X main.version=${{ github.ref_name }}" \
|
|
-o dist/patterm-${{ github.ref_name }}-linux-amd64 \
|
|
./cmd/patterm
|
|
|
|
- name: Attach binary to release
|
|
uses: akkuman/gitea-release-action@v1
|
|
with:
|
|
files: dist/patterm-${{ github.ref_name }}-linux-amd64
|