# 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}"