Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ name: Build extensions
# the newest build …/releases/download/latest/<key>.zip
# one fixed version …/releases/download/<key>-v<version>/<key>-<version>.zip
#
# And the update check (an extension's "update_url"):
# …/releases/download/latest/<key>.json = {version, url, notes}
# It names the newest version and the link of its fixed zip.
#
# A version is released once. To release a change, raise "version" in the
# extension's extension.json. The "latest" link is replaced on every push.
on:
Expand Down Expand Up @@ -87,8 +91,18 @@ jobs:
tag="$key-v$version"
if gh release view "$tag" >/dev/null 2>&1; then
echo "$tag is already released: raise the version to release a change"
# a run that died between the release and its upload left no zip:
# the update file below would point at nothing
if ! gh release view "$tag" --json assets -q '.assets[].name' | grep -qx "$file.zip"; then
gh release upload "$tag" "$zip"
fi
else
gh release create "$tag" "$zip" --target "$GITHUB_SHA" \
--title "$key $version" --notes "Build of $key, version $version."
fi
# what Sellrika's update check reads: only after the fixed zip exists
jq -n --arg version "$version" \
--arg url "https://github.com/${GITHUB_REPOSITORY}/releases/download/$tag/$file.zip" \
'{version: $version, url: $url, notes: ""}' > "$key.json"
gh release upload latest "$key.json" --clobber
done
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,9 @@ A version is released once. The `latest` link always holds the newest build.
Keep `app_version` right: the Sellrika versions the extension runs on, like `">=1.1.4"`.
Sellrika refuses a zip with no `app_version`, or one that does not fit the running app.
Raise it when the extension starts to use something new of the app.

Set `update_url` to `https://github.com/sellrika/extensions/releases/download/latest/<key>.json`.
The build writes that file on every release. Sellrika reads it every 6 hours.
When it names a newer version, **Admin › Global Extensions** shows an update badge and an **Update** button.
A Sellrika that runs an older version with no `update_url` (Blogger 1.1.7 or older) never sees it.
Import a version that has `update_url` once by link. From then on, updates show on their own.
3 changes: 2 additions & 1 deletion blogger/extension.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"key": "blogger",
"name": "name",
"version": "1.1.7",
"version": "1.1.8",
"app_version": ">=1.1.4",
"update_url": "https://github.com/sellrika/extensions/releases/download/latest/blogger.json",
"description": "description",
"icon": "assets/icon.svg",
"main": "index.ts",
Expand Down
Loading