Files
Rene KievitsandClaude Opus 5 bf2daac146
Build / build (push) Successful in 48s
ci: publish releases to Gitea instead of GitHub
The workflow was written for github.com: actions/upload-artifact failed on
the Gitea runner, softprops/action-gh-release only talks to the GitHub API,
and gen-manifest.js hardcoded github.com URLs.

- drop the artifact upload (release assets are the deliverable)
- upload release assets with tools/release-gitea.js, a dependency-free
  Gitea API client; re-running a tag replaces the attachments
- gen-manifest.js takes --server/PUBLIC_SERVER_URL and knows that Gitea
  spells the latest-asset URL /releases/download/latest/<file>
- PUBLIC_SERVER_URL is set explicitly because the runner only sees the
  instance's internal LAN address

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-05 22:41:03 +02:00

66 lines
1.8 KiB
YAML

name: Build
on:
push:
branches: ['**']
tags: ['v*']
pull_request:
workflow_dispatch:
env:
# Public URL of this Gitea instance. The runner is handed the instance's
# internal address (a LAN IP), which is no good in a manifest the TV fetches.
PUBLIC_SERVER_URL: https://git.crylia.de
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install ares CLI
run: npm install
- name: Build
run: npm run build
- name: Package IPK
run: npm run package
- name: Generate manifest and repository index
run: npm run manifest
- name: Show what was built
run: ls -la dist
# Tag a commit with v<version> (matching package.json) to publish a
# release. The repository URL for the Homebrew Channel stays stable:
# <server>/<owner>/<repo>/releases/download/latest/apps.json
- name: Write release notes
if: startsWith(github.ref, 'refs/tags/v')
run: |
cat > "${RUNNER_TEMP:-/tmp}/release-notes.md" <<EOF
Install through the Homebrew Channel by adding this repository once
(Homebrew Channel → Settings → Add repository):
\`\`\`
${PUBLIC_SERVER_URL}/${GITHUB_REPOSITORY}/releases/download/latest/apps.json
\`\`\`
That URL always resolves to the newest release, so future versions
show up as updates automatically.
Or install the \`.ipk\` below manually with \`ares-install <file>.ipk\`.
EOF
- name: Release
if: startsWith(github.ref, 'refs/tags/v')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: node tools/release-gitea.js --notes-from "${RUNNER_TEMP:-/tmp}/release-notes.md"