build: add cross-platform release target, tea publish, and Gitea Actions release
release / release (push) Successful in 3m33s

- Makefile `release`: cross-compiles CGO-free static binaries for linux/amd64,
  linux/arm64, darwin/amd64, darwin/arm64, windows/amd64 into dist/, named
  emcli_<version>_<os>_<arch>[.exe] (matching skills/emcli/scripts/install.sh),
  plus a sha256 checksums.txt. VERSION is injected into internal/version.String.
- Makefile `publish`: creates the Gitea release and uploads all dist/ assets via tea.
- .gitea/workflows/release.yml: on a v* tag, build + publish via the Gitea API.
- RELEASING.md: the local (make) and CI flows.

Verified end-to-end: `make release VERSION=v0.4.0` builds all five assets with the
version baked in; serving them locally, skills/emcli/scripts/install.sh downloads,
passes checksum verification, and the installed binary reports v0.4.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-22 20:32:22 +01:00
parent 7ad4f1adc2
commit 5e3101647d
3 changed files with 152 additions and 4 deletions
+53
View File
@@ -0,0 +1,53 @@
# Builds cross-platform binaries and publishes a Gitea release when a version tag
# (e.g. v0.4.0) is pushed. Produces the same assets as `make release` and uploads
# them — so the skill installer (skills/emcli/scripts/install.sh) can fetch them.
#
# Requires: Gitea Actions enabled with a runner that has Go, make, curl, and jq
# (the actions/checkout + actions/setup-go steps need the instance's Actions proxy).
# This workflow has not been exercised against this repo's runners yet; if a step
# is unavailable on your runner, the same result comes from `make release && make
# publish` locally (see RELEASING.md).
name: release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build release artifacts
run: make release VERSION="${GITHUB_REF_NAME}"
- name: Create release and upload assets
env:
TOKEN: ${{ github.token }}
SERVER: ${{ github.server_url }}
REPO: ${{ github.repository }}
TAG: ${{ github.ref_name }}
run: |
set -euo pipefail
# Create the release for the pushed tag.
id=$(curl -fsSL -X POST \
-H "Authorization: token ${TOKEN}" \
-H "Content-Type: application/json" \
"${SERVER}/api/v1/repos/${REPO}/releases" \
-d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\"}" | jq -r '.id')
echo "release id: ${id}"
# Upload every built asset (binaries + checksums.txt).
for f in dist/*; do
name=$(basename "$f")
echo "uploading ${name}"
curl -fsSL -X POST \
-H "Authorization: token ${TOKEN}" \
-F "attachment=@${f}" \
"${SERVER}/api/v1/repos/${REPO}/releases/${id}/assets?name=${name}" >/dev/null
done
echo "published ${TAG}"