Skip to content

Commit 37b5460

Browse files
committed
Update release script
1 parent 6a93e18 commit 37b5460

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

maintainers/upload-release.pl

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use Net::Amazon::S3;
1313

1414
my $evalId = $ARGV[0] or die "Usage: $0 EVAL-ID\n";
15-
my $nixRev = $ARGV[1] or die; # FIXME
1615

1716
my $releasesBucketName = "nix-releases";
1817
my $channelsBucketName = "nix-channels";
@@ -36,10 +35,11 @@ sub fetch {
3635
}
3736

3837
my $evalUrl = "https://hydra.nixos.org/eval/$evalId";
39-
#my $evalInfo = decode_json(fetch($evalUrl, 'application/json'));
38+
my $evalInfo = decode_json(fetch($evalUrl, 'application/json'));
4039
#print Dumper($evalInfo);
41-
42-
#my $nixRev = $evalInfo->{jobsetevalinputs}->{nix}->{revision} or die;
40+
my $flakeUrl = $evalInfo->{flake} or die;
41+
my $flakeInfo = decode_json(`nix flake metadata --json "$flakeUrl"` or die);
42+
my $nixRev = $flakeInfo->{revision} or die;
4343

4444
my $buildInfo = decode_json(fetch("$evalUrl/job/build.x86_64-linux", 'application/json'));
4545
#print Dumper($buildInfo);
@@ -48,7 +48,7 @@ sub fetch {
4848
$releaseName =~ /nix-(.*)$/ or die;
4949
my $version = $1;
5050

51-
print STDERR "Nix revision is $nixRev, version is $version\n";
51+
print STDERR "Flake URL is $flakeUrl, Nix revision is $nixRev, version is $version\n";
5252

5353
my $releaseDir = "nix/$releaseName";
5454

@@ -143,12 +143,7 @@ sub downloadFile {
143143
sub getStorePath {
144144
my ($jobName) = @_;
145145
my $buildInfo = decode_json(fetch("$evalUrl/job/$jobName", 'application/json'));
146-
for my $product (values %{$buildInfo->{buildproducts}}) {
147-
next unless $product->{type} eq "nix-build";
148-
next if $product->{path} =~ /[a-z]+$/;
149-
return $product->{path};
150-
}
151-
die;
146+
return $buildInfo->{buildoutputs}->{out}->{path} or die "cannot get store path for '$jobName'";
152147
}
153148

154149
write_file("$nixpkgsDir/nixos/modules/installer/tools/nix-fallback-paths.nix",

0 commit comments

Comments
 (0)