Files
emcli/.gitea/workflows/release.yml
T
steve 68a29ad5c7 docs: mark CI release verified; note releases must be public for the installer
The Gitea Actions workflow published v0.4.0 successfully, so drop the "untested"
caveat. Document that release assets download anonymously — the repo/releases must
be public or install.sh gets a 404 (private repos 404 unauthenticated downloads).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 20:40:45 +01:00

54 lines
1.9 KiB
YAML

# 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).
# Verified: this workflow published v0.4.0 on this instance. If a step is ever
# 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}"