inngest: init at 1.34.0 (#513849)

This commit is contained in:
Sandro
2026-07-02 22:39:01 +00:00
committed by GitHub
3 changed files with 157 additions and 0 deletions
+5
View File
@@ -14472,6 +14472,11 @@
githubId = 464625;
name = "Enric Morales";
};
kikos0 = {
github = "KiKoS0";
githubId = 22998716;
name = "Riadh Daghmoura";
};
kilianar = {
email = "mail@kilianar.de";
github = "kilianar";
+106
View File
@@ -0,0 +1,106 @@
{
lib,
buildGoModule,
fetchFromGitHub,
fetchPnpmDeps,
pnpm_10,
pnpmConfigHook,
nodejs,
stdenv,
testers,
}:
let
version = "1.34.0";
websiteRev = "159c0ac611e85ec85ffe0a8c8bf2c4a0330bdb38";
src = fetchFromGitHub {
owner = "inngest";
repo = "inngest";
tag = "v${version}";
hash = "sha256-DMJEhgKj2glNtJmsLc3oyDZr5H/COFLrcogcgaYiLjU=";
};
website = fetchFromGitHub {
owner = "inngest";
repo = "website";
rev = websiteRev;
hash = "sha256-EkTIv8jgcqzurz2M7PC6Kfh6x2Zxu7UmIhpTjlj8o88=";
};
ui = stdenv.mkDerivation (finalAttrs: {
inherit version src;
pname = "inngest-ui";
nativeBuildInputs = [
nodejs
pnpm_10
pnpmConfigHook
];
pnpmDeps = fetchPnpmDeps {
inherit (finalAttrs) pname version src;
pnpm = pnpm_10;
sourceRoot = "${finalAttrs.src.name}/ui";
fetcherVersion = 4;
hash = "sha256-bt/7cpN9EXf2CZFRAaybr7pgJyInV0fdUy7Rv/UcT/I=";
};
pnpmRoot = "ui";
buildPhase = ''
runHook preBuild
pnpm --filter dev-server-ui build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/dist
cp -r ui/apps/dev-server-ui/dist/. $out/dist/
runHook postInstall
'';
});
in
buildGoModule (finalAttrs: {
inherit version src;
pname = "inngest";
__structuredAttrs = true;
vendorHash = null;
preBuild = ''
cp -r ${ui}/dist/. ./pkg/devserver/static/
cp -r ${website}/. ./internal/embeddocs/website/
'';
postInstall = ''
mv $out/bin/cmd $out/bin/inngest
'';
ldflags = [
"-s"
"-w"
"-X github.com/inngest/inngest/pkg/inngest/version.Version=${version}"
];
env.CGO_ENABLED = 0;
subPackages = [ "cmd" ];
passthru = {
inherit ui website websiteRev;
tests.version = testers.testVersion { package = finalAttrs.finalPackage; };
updateScript = ./update.sh;
};
meta = {
description = "CLI and dev server for Inngest durable workflows";
homepage = "https://github.com/inngest/inngest";
changelog = "https://github.com/inngest/inngest/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.sspl;
sourceProvenance = with lib.sourceTypes; [ fromSource ];
maintainers = with lib.maintainers; [ kikos0 ];
mainProgram = "inngest";
platforms = lib.lists.remove "x86_64-darwin" lib.platforms.all;
};
})
+46
View File
@@ -0,0 +1,46 @@
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=./. -i bash -p gh jq
# shellcheck shell=bash
set -euo pipefail
nixpkgs="$(pwd)"
cd "$(readlink -e "$(dirname "${BASH_SOURCE[0]}")")"
nix_attr() { nix eval --json --impure --expr "(import $nixpkgs {}).$1" | jq -r; }
update_hash() {
old_hash="$(nix_attr "$1.outputHash")"
new_hash="$(nix-build --impure --expr "let src = (import $nixpkgs {}).$1; in (src.overrideAttrs or (f: src // f src)) (_: { outputHash = \"\"; outputHashAlgo = \"sha256\"; })" 2>&1 | tr -s ' ' | grep -Po "got: \K.+$")" || true
sed -i "s|${old_hash}|${new_hash}|g" package.nix
echo "$1: $old_hash -> $new_hash"
}
latest=$(gh api repos/inngest/inngest/releases/latest --jq '.tag_name' | tr -d 'v')
current=$(nix_attr inngest.version)
if [[ "$current" == "$latest" ]]; then
echo "inngest is already up to date: $current"
exit 0
fi
echo "Updating inngest $current -> $latest"
sed -i "s|version = \"${current}\"|version = \"${latest}\"|" package.nix
update_hash inngest.src
old_lock=$(gh api "repos/inngest/inngest/contents/ui/pnpm-lock.yaml?ref=v${current}" --jq '.sha')
new_lock=$(gh api "repos/inngest/inngest/contents/ui/pnpm-lock.yaml?ref=v${latest}" --jq '.sha')
if [[ "$old_lock" != "$new_lock" ]]; then
update_hash inngest.ui.pnpmDeps
else
echo "pnpm lockfile unchanged, skipping"
fi
new_rev=$(gh api "repos/inngest/inngest/contents/internal/embeddocs/website?ref=v${latest}" --jq '.sha')
old_rev=$(nix_attr inngest.websiteRev)
if [[ "$old_rev" != "$new_rev" ]]; then
sed -i "s|${old_rev}|${new_rev}|" package.nix
update_hash inngest.website
else
echo "website unchanged, skipping"
fi