Add Store support and unsigned app releases
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
# Builds, signs and uploads SmartFox packages (protocol: docs/updates.md).
|
||||
# Builds, signs and uploads Fennec OS packages (protocol: docs/updates.md).
|
||||
#
|
||||
# tools/pkg/packages.sh [--upload] [shell] [app:<id>...] [apps]
|
||||
#
|
||||
# With no package names it does the shell and every app. A package whose
|
||||
# version is already in the registry is skipped (bump the version to publish):
|
||||
# shell version = [workspace.package] version in Cargo.toml
|
||||
# app:<id> version = "version" in apps/<id>/app.toml
|
||||
# app:<id> version = "version" in apps/<id>/app.toml, or what the app's
|
||||
# hook says (tools/pkg/<id>/package.sh: Steam follows Valve's
|
||||
# official steam-launcher package)
|
||||
#
|
||||
# Environment:
|
||||
# SF_SIGNING_KEY Ed25519 private key: the PEM file base64-encoded on one
|
||||
@@ -22,7 +24,7 @@ GITEA="${SF_GITEA:-https://gitea.bluefox.support}"
|
||||
OWNER="${SF_OWNER:-bluefox}"
|
||||
OUT="${SF_OUT:-$ROOT/target/packages}"
|
||||
# Binaries in the shell package (built with cargo --release).
|
||||
SHELL_BINS=(sf-launcher sf-remote)
|
||||
SHELL_BINS=(sf-launcher sf-remote sf-core sf-miracast sf-compositor sf-update)
|
||||
|
||||
UPLOAD=0
|
||||
WANT=()
|
||||
@@ -98,10 +100,17 @@ do_shell() {
|
||||
pack sf-shell "$version" "$dir"
|
||||
}
|
||||
|
||||
# An app with a hook (tools/pkg/<id>/package.sh, e.g. Steam from Valve's
|
||||
# official package) gets its files and version from it: `--version` prints
|
||||
# the upstream version, `<dir>` fills the app folder.
|
||||
do_app() {
|
||||
local id=$1 src="$ROOT/apps/$1" version
|
||||
local id=$1 src="$ROOT/apps/$1" version hook="$ROOT/tools/pkg/$1/package.sh"
|
||||
[ -f "$src/app.toml" ] || { echo "no app $id" >&2; return 1; }
|
||||
version=$(toml_version "$src/app.toml")
|
||||
if [ -f "$hook" ]; then
|
||||
version=$(bash "$hook" --version)
|
||||
else
|
||||
version=$(toml_version "$src/app.toml")
|
||||
fi
|
||||
[ -n "$version" ] || { echo "apps/$id/app.toml has no version, skipped"; return; }
|
||||
if published "sf-app-$id" "$version"; then
|
||||
echo "sf-app-$id $version: already published"
|
||||
@@ -110,14 +119,20 @@ do_app() {
|
||||
local dir="$TMP/sf-app-$id"
|
||||
rm -rf "$dir"
|
||||
cp -r "$src" "$dir"
|
||||
if [ -f "$hook" ]; then
|
||||
[ "$(bash "$hook" "$dir" | tail -1)" = "$version" ] || { echo "$id: the hook built another version than $version" >&2; return 1; }
|
||||
fi
|
||||
chmod -R u=rwX,go=rX "$dir"
|
||||
# Git on Windows loses the x bit: programs live in bin/.
|
||||
[ -d "$dir/bin" ] && chmod -R a+x "$dir/bin"
|
||||
pack "sf-app-$id" "$version" "$dir"
|
||||
}
|
||||
|
||||
for w in "${WANT[@]}"; do
|
||||
case "$w" in
|
||||
shell) do_shell ;;
|
||||
apps) for d in "$ROOT"/apps/*/; do do_app "$(basename "$d")"; done ;;
|
||||
# A folder with its own .git is a store app developed in place: skipped.
|
||||
apps) for d in "$ROOT"/apps/*/; do [ -e "$d/.git" ] || do_app "$(basename "$d")"; done ;;
|
||||
app:*) do_app "${w#app:}" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user