2026-01-18 11:04:33 +01:00
|
|
|
#!/usr/bin/env nix-shell
|
2026-04-27 19:32:43 +02:00
|
|
|
#!nix-shell -i bash -p bash curl jq nix-update cacert git nix
|
2026-01-18 11:04:33 +01:00
|
|
|
set -euo pipefail
|
|
|
|
|
|
2026-04-29 18:40:49 +02:00
|
|
|
# n8n releases are published with two tags per version:
|
|
|
|
|
# - "n8n@X.Y.Z" - the versioned tag
|
|
|
|
|
# - "stable" - always points to the latest stable version
|
|
|
|
|
#
|
|
|
|
|
# We query the "stable" tag and extract the version from its target commitish (e.g., "release/2.18.5").
|
|
|
|
|
# This ensures we always get the actual latest stable version, not the most recently created tag.
|
|
|
|
|
|
|
|
|
|
set -euo pipefail
|
2026-04-27 19:32:43 +02:00
|
|
|
|
|
|
|
|
# Get the directory where this script lives (should be pkgs/n8n/)
|
|
|
|
|
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
|
|
|
|
|
|
# Get the nixpkgs root (parent of pkgs/)
|
|
|
|
|
nixpkgs_root="$(cd "$script_dir/../.." && pwd)"
|
|
|
|
|
|
|
|
|
|
cd "$nixpkgs_root"
|
|
|
|
|
|
2026-04-29 18:40:49 +02:00
|
|
|
# Query the "stable" tag and extract version from target_commitish (e.g., "release/2.18.5")
|
|
|
|
|
new_version=$(curl -s "https://api.github.com/repos/n8n-io/n8n/releases/tags/stable" | jq --raw-output '.target_commitish | ltrimstr("release/")')
|
2026-04-27 19:32:43 +02:00
|
|
|
|
2026-04-29 18:40:49 +02:00
|
|
|
echo "Latest stable version: n8n@${new_version}"
|
2026-04-27 19:32:43 +02:00
|
|
|
echo "Running from: $(pwd)"
|
|
|
|
|
|
|
|
|
|
# Use --flake --system to properly evaluate the flake-based package
|
|
|
|
|
nix-update --flake --system x86_64-linux n8n --version "$new_version"
|