#!/usr/bin/env bash # Creates a published Gitea Release for the tag that triggered # .gitea/workflows/release.yml, and uploads every archive in $DIST_DIR as a # release asset. # # This used to create a DRAFT, on the grounds that nobody had run the plugin # in the OBS GUI on any platform. That stopped being true on 2026-09-09, when # the v0.1.0 Windows artifact loaded into OBS 32.2.2 on Windows 11 -- so the # release publishes directly and the per-platform table below carries the # remaining caveats instead. Assets upload AFTER the release row is created # either way, so a release is briefly visible with no files attached; that is # the tradeoff for not needing a human click. # # Required env: GITEA_TOKEN, SERVER, OWNER, REPO, TAG, SHA, DIST_DIR # Optional env: MACOS_BUNDLE_FOUND ("true"/"false", default "false") set -euo pipefail : "${GITEA_TOKEN:?}" : "${SERVER:?}" : "${OWNER:?}" : "${REPO:?}" : "${TAG:?}" : "${SHA:?}" : "${DIST_DIR:?}" MACOS_BUNDLE_FOUND="${MACOS_BUNDLE_FOUND:-false}" if [ "${MACOS_BUNDLE_FOUND}" = "true" ]; then MACOS_NOTE="This archive contains a \`.plugin\` bundle." else MACOS_NOTE="This archive is packaged as a bare \`streamer-tools-camera.so\` (the layout \`build/package/\` currently produces on macOS), **not** an OBS.app-loadable \`.plugin\` bundle. It will not load in the OBS GUI as-is -- see the \"macOS packaging gap\" section of \`README.md\`." fi NOTES_FILE="$(mktemp)" cat > "${NOTES_FILE}" < Log Files -> View Current Log for \`streamer-tools-camera\` under "Loaded Modules". Then in OBS: Sources -> \`+\` -> "streamer-tools Camera" -> fill in the server URL, room slug and read key from the room's settings page -> "Refresh camera list" -> pick a camera. ## What this is Native OBS Studio source plugin that pulls streamer-tools camera feeds directly from LiveKit over WebRTC. See \`README.md\` in the repository for the full design, what is and is not verified, and current CI status. EOF echo "----- release notes -----" cat "${NOTES_FILE}" echo "--------------------------" BODY_JSON="$(python3 - "$TAG" "$NOTES_FILE" <<'PYEOF' import json, sys tag, notes_file = sys.argv[1], sys.argv[2] with open(notes_file) as f: notes = f.read() print(json.dumps({ "tag_name": tag, "name": tag, "body": notes, "draft": False, "prerelease": False, })) PYEOF )" echo "Creating release for tag ${TAG} ..." RESP="$(curl -sS -f -X POST \ -H "Authorization: token ${GITEA_TOKEN}" \ -H "Content-Type: application/json" \ -d "${BODY_JSON}" \ "${SERVER}/api/v1/repos/${OWNER}/${REPO}/releases")" RELEASE_ID="$(python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])' <<<"${RESP}")" echo "Created release id ${RELEASE_ID} (published; assets upload next)." shopt -s nullglob ASSETS=("${DIST_DIR}"/*) if [ "${#ASSETS[@]}" -eq 0 ]; then echo "::error::no archives found in ${DIST_DIR} -- nothing to upload." exit 1 fi for f in "${ASSETS[@]}"; do name="$(basename "${f}")" echo "Uploading ${name} ..." curl -sS -f -X POST \ -H "Authorization: token ${GITEA_TOKEN}" \ -F "attachment=@${f}" \ "${SERVER}/api/v1/repos/${OWNER}/${REPO}/releases/${RELEASE_ID}/assets?name=${name}" \ > /dev/null done echo "Done. Release: ${SERVER}/${OWNER}/${REPO}/releases/${RELEASE_ID}"