hex/.github/workflows/legacy-appcast.yml
Dax 4d804b8fb7
fix(site): deploy the site from a secretless build through a locked script (#248)
Security finding #528: Site ran site/ code (bun install, build.ts, vite)
in the release environment with a Cloudflare token that can write every
Worker. Site deploy now builds without an environment or secret, uploads
the Build Output with its SHA256SUMS digest, and deploys it from a job
that checks out only .github/release/, verifies the digest, and runs
deploy-site.sh: it refuses any Worker, route, or binding other than the
mode's site Worker and deploys with the cf CLI locked in
.github/release/cf/. Legacy appcast checks out only .github/release/ and
the appcast, and r2-put.sh moves under the boundary.

The deploy token is now hex-site-deploy (Scripts + anoma.ly Routes, no
R2) and the appcast key hex-r2-production-files (one bucket).
2026-10-27 21:19:57 -04:00

45 lines
1.9 KiB
YAML

name: Legacy appcast
# Replaces the frozen 2.3.1 appcast (https://anoma.ly/hex/files/appcast.xml,
# which Kit-era Macs read through Kit's redirect) with
# packaging/macos/legacy-appcast.xml: the 2.3.1 items plus one informational
# item that points those installs at https://anoma.ly/hex. Run once, with the
# first release on the release service (docs/releasing.md, "Old clients").
# The job holds the R2 key, so it checks out only .github/release/ and the
# appcast, which it treats as data, and uploads with .github/release/r2-put.sh.
on:
workflow_dispatch:
permissions:
contents: read
jobs:
publish:
runs-on: ubuntu-24.04
environment: release
env:
HEX_RELEASE_BUCKET: hex-production-files
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
sparse-checkout: |
/.github/release/
/packaging/macos/legacy-appcast.xml
sparse-checkout-cone-mode: false
persist-credentials: false
- name: Check the appcast
run: |
appcast=packaging/macos/legacy-appcast.xml
python3 -c 'import sys, xml.dom.minidom; xml.dom.minidom.parse(sys.argv[1])' "$appcast"
grep -Fq '<sparkle:informationalUpdate' "$appcast"
grep -Fq 'https://anoma.ly/hex' "$appcast"
curl -fsS https://anoma.ly/hex/files/appcast.xml -o live.xml
{ echo '### Live → new appcast'; echo '```diff'; diff -u live.xml "$appcast" || true; echo '```'; } >> "$GITHUB_STEP_SUMMARY"
- name: Upload it
env:
R2_ACCESS_KEY_ID: ${{ vars.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
run: |
sh .github/release/r2-put.sh appcast.xml packaging/macos/legacy-appcast.xml application/xml no-cache
curl -fsS -H 'Cache-Control: no-cache' "https://anoma.ly/hex/files/appcast.xml?check=$(date +%s)" \
| cmp - packaging/macos/legacy-appcast.xml