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
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -522,3 +522,54 @@ jobs:
echo
sed 's/^/ /' SHA256SUMS.txt
} >>"$GITHUB_STEP_SUMMARY"
- name: Update manifest (latest.json)
working-directory: artifacts
# What Help ▸ Check for Updates… reads (the in-app updater, crates/updater): the version, the
# release notes and, per platform, the file to download and its SHA-256. Published on every
# release — prereleases included, marked as such; the app only offers one to someone who
# ticked "Include prereleases" — it is a plain file on the release, so the check keeps
# working when GitHub's API is rate-limited. It is built after the release exists so the
# notes are the published ones ("What's New" in the dialog).
env:
DISPLAY_NAME: ${{ needs.version.outputs.display_name }}
REPO: ${{ github.repository }}
run: |
tag="v$VERSION"
# a manifest left over from a previous run of this draft must not describe this one
rm -f latest.json latest.json.new
notes="$(gh release view "$tag" --json body --jq .body)"
# the asset names are the artifacts' file names (what the app matches against)
jq -n --arg version "$VERSION" --arg name "$DISPLAY_NAME v$VERSION" \
--arg date "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
--arg tag "$tag" --arg repo "$REPO" --arg notes "$notes" \
--argjson pre "$PRERELEASE" '{
version: $version,
name: $name,
pub_date: $date,
notes: $notes,
releases: [{
tag: $tag,
name: $name,
notes: $notes,
date: $date,
prerelease: $pre,
assets: []
}]
}' > latest.json
# every artifact but the checksum list becomes an asset, with its size and SHA-256
for f in *; do
case "$f" in SHA256SUMS.txt|latest.json) continue ;; esac
[ -f "$f" ] || continue
sha="$(awk -v name="$f" '$2 == name || $2 == "*" name { print $1; exit }' SHA256SUMS.txt)"
[ -n "$sha" ] || { echo "::error::no checksum for $f"; exit 1; }
size="$(stat -c %s "$f")"
jq --arg name "$f" --arg url "https://github.com/$REPO/releases/download/$tag/$f" \
--arg sha "$sha" --argjson size "$size" \
'.releases[0].assets += [{name: $name, url: $url, size: $size, sha256: $sha}]' \
latest.json > latest.json.new
mv latest.json.new latest.json
done
jq -e '.version != "" and (.releases[0].assets | length) > 0' latest.json >/dev/null
rm -f latest.json.new
gh release upload "$tag" --clobber latest.json
jq -r '.releases[0].assets[] | "\(.name) \(.size) \(.sha256)"' latest.json
14 changes: 14 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ lcc-ui-egui = { path = "crates/ui-egui" }
lcc-mcp = { path = "crates/mcp" }
lcc-fetch = { path = "crates/fetch" }
lcc-net = { path = "crates/net" }
lcc-updater = { path = "crates/updater" }
lcc-credentials = { path = "crates/credentials" }
lcc-hash = { path = "crates/hash" }
lcc-fuzzkit = { path = "crates/fuzzkit" }
Expand Down
4 changes: 4 additions & 0 deletions crates/engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ lcc-audio-out = { workspace = true }
# model downloads run natively only (the web build fetches no models)
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
lcc-fetch = { workspace = true }
# auto updates: the release feed, the download, and starting the install
lcc-updater = { workspace = true }
lcc-immich = { workspace = true }
lcc-publish = { workspace = true }
lcc-tether = { workspace = true }
Expand All @@ -80,6 +82,8 @@ rawnind-model = ["denoise", "lcc-denoise/rawnind-model", "lcc-denoise-core/rawni
[dev-dependencies]
# HDR JPEG XL tests read the file's colour encoding
jxl-oxide = { workspace = true }
# the updater's end-to-end test builds a release with a real checksum
sha2 = { workspace = true }
# Lossless synthetic HEIC files (the import test; decoded when the codecs' `heif` feature is on).
lcc-heif = { workspace = true, features = ["testdata"] }
libc = { workspace = true }
Expand Down
4 changes: 4 additions & 0 deletions crates/engine/src/cmd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ mod quick;
mod sync;
#[cfg(not(target_arch = "wasm32"))]
pub mod tether;
#[cfg(not(target_arch = "wasm32"))]
pub mod update;
pub mod video;
#[cfg(not(target_arch = "wasm32"))]
pub mod web;
Expand Down Expand Up @@ -244,6 +246,8 @@ pub fn command_specs() -> &'static [CommandSpec] {
v.extend(edit_in::specs());
#[cfg(not(target_arch = "wasm32"))]
v.extend(plugins::specs());
#[cfg(not(target_arch = "wasm32"))]
v.extend(update::specs());
v.extend(activity::specs());
v.extend(video::specs());
v
Expand Down
Loading
Loading