Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
33 lines
1.3 KiB
Bash
Executable File
33 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env nix-shell
|
|
#!nix-shell -i bash -p git curl jq common-updater-scripts prefetch-npm-deps
|
|
|
|
set -eou pipefail
|
|
|
|
nixpkgs="$(git rev-parse --show-toplevel)"
|
|
path="$nixpkgs/pkgs/by-name/op/open-webui/package.nix"
|
|
version="$(curl --silent "https://api.github.com/repos/open-webui/open-webui/releases" | jq '.[0].tag_name' --raw-output)"
|
|
|
|
update-source-version open-webui "${version:1}" --file="$path"
|
|
|
|
# Fetch npm deps and pyodide
|
|
tmpdir=$(mktemp -d)
|
|
trap 'rm -rf "$tmpdir"' EXIT
|
|
|
|
curl -O --output-dir $tmpdir "https://raw.githubusercontent.com/open-webui/open-webui/refs/tags/${version}/package-lock.json"
|
|
curl -O --output-dir $tmpdir "https://raw.githubusercontent.com/open-webui/open-webui/refs/tags/${version}/package.json"
|
|
pushd $tmpdir
|
|
|
|
# Prefetch the npm dependencies hash
|
|
npm_hash=$(prefetch-npm-deps package-lock.json)
|
|
sed -i 's#npmDepsHash = "[^"]*"#npmDepsHash = "'"$npm_hash"'"#' "$path"
|
|
|
|
# Extract pyodide version
|
|
pyodide_version=$(sed -rn 's/^.*pyodide.*\^([0-9.]*)\".*$/\1/p' package.json)
|
|
popd
|
|
|
|
# Update the pyodide version if necessary
|
|
current_pyodide_version=$(nix eval --raw -f . open-webui.frontend.pyodideVersion)
|
|
if [ "$current_pyodide_version" < "$pyodide_version" ]; then
|
|
update-source-version open-webui.frontend "${pyodide_version}" --file="$path" --version-key=pyodideVersion --source-key=pyodide
|
|
fi
|