forked from serokell/tezos-packaging
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.nix
37 lines (33 loc) · 1.76 KB
/
release.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# SPDX-FileCopyrightText: 2019 TQ Tezos <https://tqtezos.com/>
#
# SPDX-License-Identifier: LicenseRef-MIT-TQ
{ writeTextDir, runCommand, buildEnv, binaries, arm-binaries, commonMeta, replaceStrings }:
let
release-binaries = import ./nix/build/release-binaries.nix;
version = replaceStrings ["refs/tags/"] [""] commonMeta.branchName;
release-notes = writeTextDir "release-notes.md" ''
This release contains assets based on the [${version} release](https://gitlab.com/tezos/tezos/tree/${version}).
Binaries that target arm64 architecture have the `-arm64` suffix in their name.
All the other binaries target x86_64.
Release artifacts are signed with the following key: 0x7EAF9B150ACE940CF8C008A0BF847A85AC7BF43E.
You can check it on http://keys.gnupg.net/.
Descriptions for binaries included in this release:
${builtins.concatStringsSep "\n"
(map ({ name, description, ... }: "- `${name}`: ${description}")
release-binaries)}
'';
releaseNoTarball = buildEnv {
name = "tezos-release-no-tarball";
paths = [ "${binaries}" "${arm-binaries}" LICENSE release-notes ];
};
tarballName = "binaries-${commonMeta.version}-${commonMeta.release}.tar.gz";
armTarballName = "binaries-${commonMeta.version}-${commonMeta.release}-arm64.tar.gz";
binariesTarball = runCommand "binaries-tarball" { }
"mkdir $out; tar --owner=serokell:1000 --mode='u+rwX' -czhf $out/${tarballName} -C ${binaries} .";
armBinariesTarball = runCommand "binaries-tarball" { }
"mkdir $out; tar --owner=serokell:1000 --mode='u+rwX' -czhf $out/${armTarballName} -C ${arm-binaries} .";
LICENSE = writeTextDir "LICENSE" (builtins.readFile commonMeta.licenseFile);
in buildEnv {
name = "tezos-release";
paths = [ releaseNoTarball binariesTarball armBinariesTarball ];
}