From 0c5e5ca00ac2cd1c521e10412b36eb7b7a9f1cbd Mon Sep 17 00:00:00 2001 From: Hugo Renard Date: Wed, 27 Nov 2024 09:46:23 +0100 Subject: [PATCH] ci: derive version from pom.xml --- flake.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index acddbedcaa..0e7efc2dee 100644 --- a/flake.nix +++ b/flake.nix @@ -20,7 +20,13 @@ { packages.default = pkgs.maven.buildMavenPackage rec { pname = "keycloak-scim"; - version = "1.0-SNAPSHOT"; + version = ( + builtins.readFile ( + pkgs.runCommand "version" { } '' + ${pkgs.coreutils}/bin/cat ${src}/pom.xml | ${pkgs.xq-xml}/bin/xq -x "project/version" | ${pkgs.coreutils}/bin/tr -d '\n' > $out + '' + ) + ); src = ./.; mvnHash = "sha256-y3ASPCAbgwSJNu4NiBeWNFc8YA903C0e5z0/TSlc3Og=";