mirror of
https://github.com/InstanceBrick/nightcap.git
synced 2026-10-19 10:00:51 +02:00
New intro and feature list in the README and the site. The site gets a title with Roblox, link preview tags, structured data, a sitemap, robots.txt, a preview image and the Search Console tag. Screenshots are retaken, the old lobby shot is removed and the store listing points at the new ones.
92 lines
2.9 KiB
Bash
Executable File
92 lines
2.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Modified by vii from komaruworld/mocktail. See README "About this fork".
|
|
# Copyright 2026 Mocktail Project Authors
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
set -Eeuo pipefail
|
|
umask 022
|
|
|
|
readonly REPOSITORY="${1:?Flatpak repository path is required}"
|
|
readonly BUNDLE="${2:?Flatpak bundle path is required}"
|
|
readonly PUBLIC_KEY="${3:?GPG public key path is required}"
|
|
readonly OUTPUT="${4:?Pages output path is required}"
|
|
readonly BASE_URL="https://coderdayton.github.io/nightcap"
|
|
readonly APP_ID="io.github.CoderDayton.nightcap"
|
|
readonly SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
|
|
readonly PROJECT_DIR="$(dirname -- "${SCRIPT_DIR}")"
|
|
|
|
[[ -d "${REPOSITORY}" && ! -L "${REPOSITORY}" ]] || {
|
|
printf 'Flatpak repository is missing or unsafe: %s\n' "${REPOSITORY}" >&2
|
|
exit 1
|
|
}
|
|
[[ -f "${BUNDLE}" && ! -L "${BUNDLE}" ]] || {
|
|
printf 'Flatpak bundle is missing or unsafe: %s\n' "${BUNDLE}" >&2
|
|
exit 1
|
|
}
|
|
[[ -s "${PUBLIC_KEY}" && ! -L "${PUBLIC_KEY}" ]] || {
|
|
printf 'Flatpak public key is missing or unsafe: %s\n' "${PUBLIC_KEY}" >&2
|
|
exit 1
|
|
}
|
|
[[ ! -e "${OUTPUT}" ]] || {
|
|
printf 'Pages output already exists: %s\n' "${OUTPUT}" >&2
|
|
exit 1
|
|
}
|
|
|
|
mkdir -p -- "${OUTPUT}"
|
|
cp -a -- "${REPOSITORY}" "${OUTPUT}/repo"
|
|
install -m 0644 -- "${BUNDLE}" "${OUTPUT}/Nightcap-x86_64.flatpak"
|
|
install -m 0644 -- "${PUBLIC_KEY}" "${OUTPUT}/nightcap-flatpak.gpg"
|
|
install -m 0644 -- \
|
|
"${PROJECT_DIR}/packaging/${APP_ID}.svg" \
|
|
"${OUTPUT}/nightcap.svg"
|
|
touch -- "${OUTPUT}/.nojekyll"
|
|
|
|
readonly GPG_KEY="$(base64 --wrap=0 "${PUBLIC_KEY}")"
|
|
|
|
cat >"${OUTPUT}/nightcap.flatpakrepo" <<EOF
|
|
[Flatpak Repo]
|
|
Title=Nightcap
|
|
Url=${BASE_URL}/repo/
|
|
Homepage=https://github.com/CoderDayton/nightcap
|
|
Comment=Nightcap releases
|
|
Description=Signed x86_64 release builds of Nightcap
|
|
Icon=${BASE_URL}/nightcap.svg
|
|
GPGKey=${GPG_KEY}
|
|
EOF
|
|
|
|
cat >"${OUTPUT}/nightcap.flatpakref" <<EOF
|
|
[Flatpak Ref]
|
|
Title=Nightcap
|
|
Name=${APP_ID}
|
|
Branch=stable
|
|
Url=${BASE_URL}/repo/
|
|
RuntimeRepo=https://dl.flathub.org/repo/flathub.flatpakrepo
|
|
Homepage=https://github.com/CoderDayton/nightcap
|
|
Comment=Roblox on Linux, tuned for desktop play
|
|
Icon=${BASE_URL}/nightcap.svg
|
|
GPGKey=${GPG_KEY}
|
|
IsRuntime=false
|
|
EOF
|
|
|
|
install -m 0644 -- "${PROJECT_DIR}/site/index.html" "${OUTPUT}/index.html"
|
|
install -m 0644 -- "${PROJECT_DIR}/site/styles.css" "${OUTPUT}/styles.css"
|
|
install -m 0644 -- "${PROJECT_DIR}/site/terms.html" "${OUTPUT}/terms.html"
|
|
install -m 0644 -- "${PROJECT_DIR}/site/privacy.html" "${OUTPUT}/privacy.html"
|
|
install -m 0644 -- "${PROJECT_DIR}/site/preview.png" "${OUTPUT}/preview.png"
|
|
|
|
cat >"${OUTPUT}/robots.txt" <<EOF
|
|
User-agent: *
|
|
Allow: /
|
|
|
|
Sitemap: ${BASE_URL}/sitemap.xml
|
|
EOF
|
|
|
|
cat >"${OUTPUT}/sitemap.xml" <<EOF
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
<url><loc>${BASE_URL}/</loc></url>
|
|
<url><loc>${BASE_URL}/terms.html</loc></url>
|
|
<url><loc>${BASE_URL}/privacy.html</loc></url>
|
|
</urlset>
|
|
EOF
|