Skip to content

Commit

Permalink
Explicitly expose version to avoid release script failure (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
philiptaron authored Apr 10, 2024
2 parents 6d09601 + 5817515 commit 90d32e5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ let
nix-store --init
'';

# Determine version from Cargo.toml
version = (lib.importTOML ./Cargo.toml).package.version;

results = {
# We're using this value as the root result. By default, derivations expose all of their
# internal attributes, which is very messy. We prevent this using lib.lazyDerivation
build = lib.lazyDerivation {
derivation = pkgs.callPackage ./package.nix {
inherit nixpkgsLibPath initNix runtimeExprPath testNixpkgsPath;
inherit nixpkgsLibPath initNix runtimeExprPath testNixpkgsPath version;
};
};

Expand Down Expand Up @@ -132,4 +134,6 @@ results.build // results // {
# Built by CI
ci = pkgs.linkFarm "ci" results;

# Used by CI to determine whether a new version should be released
inherit version;
}
2 changes: 1 addition & 1 deletion package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
initNix,
runtimeExprPath,
testNixpkgsPath,
version,
}:
let
fs = lib.fileset;
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version;
in
rustPlatform.buildRustPackage {
pname = "nixpkgs-check-by-name";
Expand Down
2 changes: 1 addition & 1 deletion scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ root=$(git rev-parse --show-toplevel)
repository=${GITHUB_REPOSITORY:-NixOS/nixpkgs-check-by-name}

# Get the version from the Cargo.toml file
version=$(nixeval "$root" -A build.version)
version=$(nixeval "$root" -A version)
echo "Current version is $version"

if existingRelease=$(gh api \
Expand Down

0 comments on commit 90d32e5

Please sign in to comment.