Files
Dark Steveneq 646b892680
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
push sheeet
2025-10-09 14:15:47 +02:00

35 lines
775 B
Bash
Executable File

#!/usr/bin/env nix-shell
#!nix-shell -i bash -p yq ripgrep common-updater-scripts dart
set -xeu -o pipefail
PACKAGE_DIR="$(realpath "$(dirname "$0")")"
cd "$PACKAGE_DIR/.."
while ! test -f flake.nix; do cd ..; done
NIXPKGS_DIR="$PWD"
version="$(
list-git-tags --url=https://github.com/google/protobuf.dart |
rg '^protoc_plugin-v(.*)' -r '$1' |
sort --version-sort |
tail -n1
)"
cd "$NIXPKGS_DIR"
update-source-version protoc-gen-dart "$version"
TMPDIR="$(mktemp -d)"
cd "$TMPDIR"
src="$(nix-build --no-link "$NIXPKGS_DIR" -A protoc-gen-dart.src)/protoc_plugin"
cp $src/pubspec.* .
if ! test -f pubspec.lock; then
sed -i '/resolution: workspace/d' pubspec.yaml
dart pub update
fi
yq . pubspec.lock >"$PACKAGE_DIR/pubspec.lock.json"
rm -rf "$TMPDIR"