Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

ci: publish nightly builds under stable URLs

Gabe Kangas1e1266c114ee
diff --git a/.github/workflows/container.yaml b/.github/workflows/container.yaml
index 9e6f113443..c1a0ad8651 100644
--- a/.github/workflows/container.yaml
+++ b/.github/workflows/container.yaml
@@ -118,7 +118,13 @@ jobs:
export AWS_ACCESS_KEY_ID="$S3_ACCESS_KEY" AWS_SECRET_ACCESS_KEY="$S3_SECRET"
export AWS_DEFAULT_REGION="${S3_REGION:-us-east-1}"
PREFIX="nightly"
- aws s3 rm "s3://$S3_BUCKET/$PREFIX/" --recursive --endpoint-url "$S3_ENDPOINT" --quiet || true
+ # Stable keys (owncast-nightly-<arch>.zip) and index.html are overwritten
+ # in place below, so no wipe is needed. Only sweep legacy date-stamped
+ # zips (owncast-<date>-nightly-*) left over from the old naming scheme;
+ # the include pattern never matches the stable keys, so links never 403.
+ aws s3 rm "s3://$S3_BUCKET/$PREFIX/" --recursive \
+ --exclude "*" --include "owncast-2*-nightly-*" \
+ --endpoint-url "$S3_ENDPOINT" --quiet || true
# Owncast-built ffmpeg binaries from the latest ffmpeg-builds release.
# Best effort: if the API call fails the section just lists nothing
@@ -138,25 +144,36 @@ jobs:
for f in dist/*.zip; do
name=$(basename "$f")
size=$(du -h "$f" | cut -f1)
+ # Link to a stable, un-dated key (e.g. owncast-nightly-linux-64bit.zip)
+ # that always points at the latest build. The dated filenames are wiped
+ # and re-created every night, so any consumer that caches this page
+ # (e.g. the docs site's fetch-nightly-builds.js) would otherwise link to
+ # objects that no longer exist and get a 403 AccessDenied.
+ stable="owncast-nightly-${name#owncast-$VERSION-}"
printf '<li><a href="%s/%s/%s/%s">%s</a> (%s)</li>\n' \
- "$S3_ENDPOINT" "$S3_BUCKET" "$PREFIX" "$name" "$name" "$size"
+ "$S3_ENDPOINT" "$S3_BUCKET" "$PREFIX" "$stable" "$name" "$size"
done
printf '%s\n' \
'</ul>' \
+ '<p>Also available as a Docker image:' \
+ '<a href="https://github.com/owncast/owncast/pkgs/container/owncast"><code>ghcr.io/owncast/owncast:nightly</code></a></p>' \
'<h2>ffmpeg</h2>' \
'<p>Owncast-built <a href="https://github.com/owncast/ffmpeg-builds/releases/latest">ffmpeg binaries</a>:</p>' \
'<ul>'
printf '%s\n' "$FFMPEG_ASSETS"
printf '%s\n' \
'</ul>' \
- '<p>Also available as a Docker image:' \
- '<a href="https://github.com/owncast/owncast/pkgs/container/owncast"><code>ghcr.io/owncast/owncast:nightly</code></a></p>' \
'</body></html>'
} > dist/index.html
for f in dist/*.zip; do
- aws s3 cp "$f" "s3://$S3_BUCKET/$PREFIX/$(basename "$f")" --endpoint-url "$S3_ENDPOINT" \
- --acl public-read --content-type application/zip --no-progress
+ name=$(basename "$f")
+ stable="owncast-nightly-${name#owncast-$VERSION-}"
+ # Stable key for a durable URL; Content-Disposition preserves the dated
+ # filename when the browser saves the download.
+ aws s3 cp "$f" "s3://$S3_BUCKET/$PREFIX/$stable" --endpoint-url "$S3_ENDPOINT" \
+ --acl public-read --content-type application/zip \
+ --content-disposition "attachment; filename=$name" --no-progress
done
aws s3 cp dist/index.html "s3://$S3_BUCKET/$PREFIX/index.html" --endpoint-url "$S3_ENDPOINT" \
--acl public-read --content-type text/html --no-progress